{
  "info": {
    "contact": {
      "email": "engineer@eigenn.io",
      "name": "The Eigenn Team",
      "url": "https://eigenn.io"
    },
    "description": "Eigenn is a platform for invoicing, time tracking, file reconciliation, storage, financial overview, and operational automation.",
    "license": {
      "name": "Apache-2.0 license",
      "url": "https://github.com/Oppulence-Engineering/oppulence-canvas/blob/main/LICENSE"
    },
    "title": "Eigenn API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "servers": [
    {
      "description": "Production API",
      "url": "https://api.eigenn.io/v1"
    },
    {
      "description": "Sandbox API (staging-backed)",
      "url": "https://api-staging.eigenn.io/v1"
    }
  ],
  "tags": [
    {
      "description": "Manage linked bank accounts, balances, and metadata.",
      "name": "Bank Accounts"
    },
    {
      "description": "Create, update, and manage customer records and contacts.",
      "name": "Customers"
    },
    {
      "description": "Access documents and generate secure attachment URLs.",
      "name": "Documents"
    },
    {
      "description": "Manage inbox items, comments, and attachment access.",
      "name": "Inbox"
    },
    {
      "description": "Create, update, deliver, and manage invoice lifecycle.",
      "name": "Invoices"
    },
    {
      "description": "Analytics endpoints for performance, revenue, and growth.",
      "name": "Metrics"
    },
    {
      "description": "Read and update notification state for users and teams.",
      "name": "Notifications"
    },
    {
      "description": "OAuth authorization and token exchange flows.",
      "name": "OAuth"
    },
    {
      "description": "Search across core entities with filtering support.",
      "name": "Search"
    },
    {
      "description": "CRUD for transaction tags and taxonomies.",
      "name": "Tags"
    },
    {
      "description": "Team metadata, preferences, and configuration.",
      "name": "Teams"
    },
    {
      "description": "Time tracking entries, updates, and summaries.",
      "name": "Tracker Entries"
    },
    {
      "description": "Projects used for tracking time entries.",
      "name": "Tracker Projects"
    },
    {
      "description": "Start, stop, and inspect active tracking timers.",
      "name": "Tracker Timer"
    },
    {
      "description": "Manage transaction category taxonomy and hierarchy.",
      "name": "Transaction Categories"
    },
    {
      "description": "Create, update, categorize, and reconcile transactions.",
      "name": "Transactions"
    },
    {
      "description": "User profile and membership information.",
      "name": "Users"
    }
  ],
  "components": {
    "securitySchemes": {
      "token": {
        "description": "Send `Authorization: Bearer <token>` with either an Eigenn API key or an OAuth access token.",
        "scheme": "bearer",
        "type": "http",
        "x-speakeasy-example": "mid_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      },
      "oauth2": {
        "description": "OAuth 2.0 with authorization code and client credentials flows.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "./oauth/authorize",
            "refreshUrl": "./oauth/token",
            "scopes": {
              "bank-accounts.read": "Read bank accounts resources.",
              "bank-accounts.write": "Write bank accounts resources.",
              "chat.read": "Read chat resources.",
              "chat.write": "Write chat resources.",
              "customers.read": "Read customers resources.",
              "customers.write": "Write customers resources.",
              "documents.read": "Read documents resources.",
              "documents.write": "Write documents resources.",
              "inbox.read": "Read inbox resources.",
              "inbox.write": "Write inbox resources.",
              "invoices.read": "Read invoices resources.",
              "invoices.write": "Write invoices resources.",
              "metrics.read": "Read metrics resources.",
              "metrics.write": "Write metrics resources.",
              "reports.read": "Read reports resources.",
              "reports.write": "Write reports resources.",
              "search.read": "Read search resources.",
              "tags.read": "Read tags resources.",
              "tags.write": "Write tags resources.",
              "teams.read": "Read teams resources.",
              "teams.write": "Write teams resources.",
              "tracker-entries.read": "Read tracker entries resources.",
              "tracker-entries.write": "Write tracker entries resources.",
              "tracker-projects.read": "Read tracker projects resources.",
              "tracker-projects.write": "Write tracker projects resources.",
              "transactions.read": "Read transactions resources.",
              "transactions.write": "Write transactions resources.",
              "users.read": "Read users resources.",
              "users.write": "Write users resources.",
              "notifications.read": "Read notifications resources.",
              "notifications.write": "Write notifications resources.",
              "apis.all": "Full access to every API resource.",
              "apis.read": "Read access to every readable API resource."
            },
            "tokenUrl": "./oauth/token"
          },
          "clientCredentials": {
            "scopes": {
              "bank-accounts.read": "Read bank accounts resources.",
              "bank-accounts.write": "Write bank accounts resources.",
              "chat.read": "Read chat resources.",
              "chat.write": "Write chat resources.",
              "customers.read": "Read customers resources.",
              "customers.write": "Write customers resources.",
              "documents.read": "Read documents resources.",
              "documents.write": "Write documents resources.",
              "inbox.read": "Read inbox resources.",
              "inbox.write": "Write inbox resources.",
              "invoices.read": "Read invoices resources.",
              "invoices.write": "Write invoices resources.",
              "metrics.read": "Read metrics resources.",
              "metrics.write": "Write metrics resources.",
              "reports.read": "Read reports resources.",
              "reports.write": "Write reports resources.",
              "search.read": "Read search resources.",
              "tags.read": "Read tags resources.",
              "tags.write": "Write tags resources.",
              "teams.read": "Read teams resources.",
              "teams.write": "Write teams resources.",
              "tracker-entries.read": "Read tracker entries resources.",
              "tracker-entries.write": "Write tracker entries resources.",
              "tracker-projects.read": "Read tracker projects resources.",
              "tracker-projects.write": "Write tracker projects resources.",
              "transactions.read": "Read transactions resources.",
              "transactions.write": "Write transactions resources.",
              "users.read": "Read users resources.",
              "users.write": "Write users resources.",
              "notifications.read": "Read notifications resources.",
              "notifications.write": "Write notifications resources.",
              "apis.all": "Full access to every API resource.",
              "apis.read": "Read access to every readable API resource."
            },
            "tokenUrl": "./oauth/token"
          }
        },
        "type": "oauth2"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Short error label.",
            "example": "Unauthorized"
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message.",
            "example": "Invalid API key"
          },
          "description": {
            "type": "string",
            "description": "Additional context for the error.",
            "example": "Insufficient permissions. Required scopes: transactions.read."
          },
          "requestId": {
            "type": "string",
            "description": "Request correlation id for support.",
            "example": "req_01HXYZ1ABCD23EFGH456JK"
          },
          "retryAfterSeconds": {
            "type": "integer",
            "description": "Seconds until a new request is allowed.",
            "example": 60
          }
        },
        "description": "Standard error payload returned by REST endpoints. Fields may vary by error type.",
        "example": {
          "error": "Unauthorized",
          "message": "Invalid API key",
          "description": "Authentication failed. Provide a valid Bearer token or API key.",
          "requestId": "req_01HXYZ1ABCD23EFGH456JK",
          "retryAfterSeconds": 60
        }
      },
      "TransactionsSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionSchema"
            }
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pagination cursor for the next page of transactions",
            "example": "CAESFgoQAB..."
          }
        },
        "required": [
          "data"
        ]
      },
      "TransactionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "9293961c-df93-4d6d-a2cc-fc3e353b2d10"
          },
          "accountId": {
            "type": "string",
            "description": "Provider account identifier that produced this transaction",
            "example": "acc_os41qe3a66ks2djhss000"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "example": "Transfer to bank account"
          },
          "method": {
            "type": [
              "string",
              "null"
            ],
            "example": "other"
          },
          "amount": {
            "type": "number",
            "example": 100
          },
          "name": {
            "type": "string",
            "example": "Vercel Inc."
          },
          "date": {
            "type": "string",
            "example": "2024-06-12"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "posted"
            ],
            "example": "posted"
          },
          "counterparty_name": {
            "type": [
              "string",
              "null"
            ],
            "example": "Spotify AB"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "example": "travel"
          },
          "balance": {
            "type": [
              "number",
              "null"
            ],
            "example": 10000
          }
        },
        "required": [
          "id",
          "accountId",
          "description",
          "method",
          "amount",
          "name",
          "date",
          "currency",
          "status",
          "counterparty_name",
          "category",
          "balance"
        ]
      },
      "AccountsSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSchema"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "AccountSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "9293961c-df93-4d6d-a2cc-fc3e353b2d10"
          },
          "name": {
            "type": "string",
            "example": "Savings account"
          },
          "type": {
            "type": "string",
            "enum": [
              "depository",
              "credit",
              "other_asset",
              "loan",
              "other_liability"
            ],
            "example": "depository"
          },
          "balance": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "number",
                "example": 100
              },
              "currency": {
                "type": "string",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ]
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "institution": {
            "$ref": "#/components/schemas/InstitutionSchema"
          },
          "enrollment_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Teller/Plaid enrollment id",
            "example": "add29d44-1b36-4bcc-b317-b2cbc73ab8e7"
          },
          "resource_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "GoCardLess reference id",
            "example": "GBRGZX62Y8"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "EnableBanking or GoCardLess access valid until",
            "example": "2024-03-06"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "balance",
          "currency",
          "institution",
          "enrollment_id",
          "resource_id",
          "expires_at"
        ]
      },
      "InstitutionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "9293961c-df93-4d6d-a2cc-fc3e353b2d10"
          },
          "name": {
            "type": "string",
            "example": "Wells Fargo Bank"
          },
          "logo": {
            "type": [
              "string",
              "null"
            ],
            "example": "https://cdn.eigenn.io/institution/9293961c-df93-4d6d-a2cc-fc3e353b2d10.jpg"
          },
          "available_history": {
            "type": [
              "number",
              "null"
            ],
            "example": 365
          },
          "maximum_consent_validity": {
            "type": [
              "number",
              "null"
            ],
            "example": 365
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "personal",
              "business",
              null
            ],
            "example": "personal"
          },
          "popularity": {
            "type": "number",
            "example": 1
          },
          "country": {
            "type": "string",
            "example": "GB"
          },
          "provider": {
            "type": "string",
            "enum": [
              "teller",
              "plaid",
              "gocardless",
              "enablebanking",
              "stripe"
            ],
            "example": "teller"
          }
        },
        "required": [
          "id",
          "name",
          "logo"
        ]
      },
      "DeleteSchema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          }
        },
        "required": [
          "success"
        ]
      },
      "AccountBalanceSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "number",
                "example": 20000
              },
              "currency": {
                "type": "string",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "InstitutionsSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstitutionSchema"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateUsageSchema": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/InstitutionSchema"
          }
        },
        "required": [
          "data"
        ]
      },
      "PlaidLinkSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "link_token": {
                "type": "string",
                "example": "ojwmef9823f892n9h98h2efoqed9823hdodfcoj13er92hef"
              },
              "expiration": {
                "type": "string",
                "example": "2024-06-01"
              }
            },
            "required": [
              "link_token",
              "expiration"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "PlaidLinkBodySchema": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "example": "9293961c-df93-4d6d-a2cc-fc3e353b2d10"
          },
          "language": {
            "type": "string",
            "example": "en"
          },
          "accessToken": {
            "type": "string",
            "example": "ojwmef9823f892n9h98h2efoqed9823hdodfcoj13er92hef",
            "description": "Used when initiating the reconnect flow"
          }
        },
        "required": [
          "userId"
        ]
      },
      "PlaidExchangeSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "access_token": {
                "type": "string",
                "example": "access_9293961c"
              },
              "item_id": {
                "type": "string",
                "example": "item_9293961c"
              }
            },
            "required": [
              "access_token",
              "item_id"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "PlaidExchangeBodySchema": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "example": "ojwmef9823f892n9h98h2efoqed9823hdodfcoj13er92hef"
          }
        },
        "required": [
          "token"
        ]
      },
      "GoCardLessLinkSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "link": {
                "type": "string",
                "example": "https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/REVOLUT_REVOGB21"
              }
            },
            "required": [
              "link"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "GoCardLessLinkBodySchema": {
        "type": "object",
        "properties": {
          "institutionId": {
            "type": "string",
            "example": "REVOLUT_REVOGB21"
          },
          "redirect": {
            "type": "string",
            "example": "http://www.yourwebpage.com"
          },
          "agreement": {
            "type": [
              "string",
              "null"
            ],
            "example": "2dea1b84-97b0-4cb4-8805-302c227587c8"
          },
          "reference": {
            "type": "string",
            "example": "1234567890"
          }
        },
        "required": [
          "institutionId",
          "redirect"
        ]
      },
      "GoCardLessAgreementSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "2dea1b84-97b0-4cb4-8805-302c227587c8"
              },
              "created": {
                "type": "string",
                "example": "2024-01-01"
              },
              "access_valid_for_days": {
                "type": "number",
                "example": 90
              },
              "max_historical_days": {
                "type": "number",
                "example": 90
              },
              "institution_id": {
                "type": "string",
                "example": "REVOLUT_REVOGB21"
              },
              "accepted": {
                "type": "boolean",
                "example": true
              }
            },
            "required": [
              "id",
              "created",
              "access_valid_for_days",
              "max_historical_days",
              "institution_id",
              "accepted"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "GoCardLessAgreementBodySchema": {
        "type": "object",
        "properties": {
          "institutionId": {
            "type": "string",
            "example": "REVOLUT_REVOGB21"
          },
          "transactionTotalDays": {
            "type": "number",
            "example": 90
          }
        },
        "required": [
          "institutionId",
          "transactionTotalDays"
        ]
      },
      "GoCardLessExchangeSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "2dea1b84-97b0-4cb4-8805-302c227587c8"
              },
              "access_valid_for_days": {
                "type": "number",
                "example": 90
              },
              "max_historical_days": {
                "type": "number",
                "example": 90
              },
              "institution_id": {
                "type": "string",
                "example": "REVOLUT_REVOGB21"
              }
            },
            "required": [
              "id",
              "access_valid_for_days",
              "max_historical_days",
              "institution_id"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "GoCardLessExchangeBodySchema": {
        "type": "object",
        "properties": {
          "institutionId": {
            "type": "string",
            "example": "REVOLUT_REVOGB21"
          },
          "transactionTotalDays": {
            "type": "number",
            "example": 90
          }
        },
        "required": [
          "institutionId",
          "transactionTotalDays"
        ]
      },
      "EnableBankingLinkResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "example": "https://ob.enablebanking.com/psd2/start/234234234"
              }
            },
            "required": [
              "url"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "EnableBankingLinkBodySchema": {
        "type": "object",
        "properties": {
          "institutionId": {
            "type": "string",
            "example": "REVOLUT_REVOGB21"
          },
          "country": {
            "type": "string",
            "example": "GB"
          },
          "teamId": {
            "type": "string",
            "example": "1234567890"
          },
          "validUntil": {
            "type": "string",
            "example": "2024-01-01"
          },
          "type": {
            "type": "string",
            "enum": [
              "personal",
              "business"
            ],
            "example": "personal"
          },
          "state": {
            "type": "string",
            "example": "1234567890",
            "description": "Arbitrary string. Same string will be returned in query parameter when redirecting to the URL passed via redirect_url parameter"
          }
        },
        "required": [
          "institutionId",
          "country",
          "teamId",
          "validUntil",
          "type",
          "state"
        ]
      },
      "EnableBankingSessionSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "session_id": {
                "type": "string",
                "example": "234234234"
              },
              "expires_at": {
                "type": "string",
                "example": "2024-01-01"
              },
              "accounts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "account_reference": {
                      "type": "string",
                      "example": "234234234"
                    },
                    "account_id": {
                      "type": "string",
                      "example": "234234234"
                    }
                  },
                  "required": [
                    "account_reference",
                    "account_id"
                  ]
                }
              }
            },
            "required": [
              "session_id",
              "expires_at",
              "accounts"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "ConnectionStatusSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "example": "connected"
              }
            },
            "required": [
              "status"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "HealthSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "plaid": {
                "type": "object",
                "properties": {
                  "healthy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "healthy"
                ]
              },
              "gocardless": {
                "type": "object",
                "properties": {
                  "healthy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "healthy"
                ]
              },
              "teller": {
                "type": "object",
                "properties": {
                  "healthy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "healthy"
                ]
              },
              "enablebanking": {
                "type": "object",
                "properties": {
                  "healthy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "healthy"
                ]
              },
              "stripe": {
                "type": "object",
                "properties": {
                  "healthy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "healthy"
                ]
              },
              "search": {
                "type": "object",
                "properties": {
                  "healthy": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "healthy"
                ]
              }
            },
            "required": [
              "plaid",
              "gocardless",
              "teller",
              "enablebanking",
              "stripe",
              "search"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "RatesSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "example": "2024-02-29"
              },
              "usd": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                },
                "example": {
                  "EUR": 0.925393,
                  "GBP": 0.792256,
                  "SEK": 10,
                  "BDT": 200
                }
              }
            },
            "required": [
              "date",
              "usd"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "RateTypeSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "example": "2024-02-29"
              },
              "rate": {
                "type": "number",
                "example": 0.925393
              }
            },
            "required": [
              "date",
              "rate"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "StatementPdfResponse": {
        "type": "string",
        "format": "binary",
        "description": "Binary PDF payload for the requested statement."
      },
      "NotificationSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the notification",
            "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
          },
          "createdAt": {
            "type": "string",
            "description": "ISO timestamp when the notification was created",
            "example": "2024-04-15T09:00:00.000Z"
          },
          "teamId": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the team",
            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          },
          "userId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Unique identifier of the user (if applicable)",
            "example": "c2d3e4f5-a6b7-8901-bcde-f23456789012"
          },
          "type": {
            "type": "string",
            "description": "Type of notification",
            "example": "transactions_created"
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "description": "Priority level of the notification (1-3 = user notifications, 4-10 = insights)",
            "example": 3
          },
          "source": {
            "type": "string",
            "enum": [
              "system",
              "user"
            ],
            "description": "Source of the notification",
            "example": "system"
          },
          "status": {
            "type": "string",
            "enum": [
              "unread",
              "read",
              "archived"
            ],
            "description": "Current status of the notification",
            "example": "unread"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {},
            "description": "Additional metadata for the notification",
            "example": {
              "transactionCount": 5,
              "dateRange": {
                "from": "2024-04-01",
                "to": "2024-04-15"
              }
            }
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO timestamp when the notification was last used by the system",
            "example": "2024-04-15T11:00:00.000Z"
          }
        },
        "required": [
          "id",
          "createdAt",
          "teamId",
          "userId",
          "type",
          "priority",
          "source",
          "status",
          "metadata",
          "lastUsedAt"
        ]
      },
      "NotificationResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NotificationSchema"
              },
              {
                "description": "The updated notification"
              }
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateAllNotificationsStatusResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationSchema"
            },
            "description": "Array of updated notifications"
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateAllNotificationsStatusSchema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "unread",
              "read",
              "archived"
            ],
            "description": "The new status to apply to all notifications for the authenticated user",
            "example": "read"
          }
        },
        "required": [
          "status"
        ]
      },
      "TransactionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the transaction",
            "example": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
          },
          "internalId": {
            "type": "string",
            "description": "Internal identifier for the transaction",
            "example": "txn_20240501_001"
          },
          "name": {
            "type": "string",
            "description": "Name or description of the transaction",
            "example": "Office Supplies Purchase"
          },
          "amount": {
            "type": "number",
            "description": "Monetary amount of the transaction",
            "example": 150.75
          },
          "balance": {
            "type": [
              "number",
              "null"
            ],
            "description": "Account balance after this transaction",
            "example": 1250.55
          },
          "baseAmount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Transaction amount converted to the team base currency",
            "example": 150.75
          },
          "baseCurrency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base currency code used for baseAmount",
            "example": "USD"
          },
          "taxAmount": {
            "type": [
              "number",
              "null"
            ],
            "description": "Tax amount of the transaction",
            "example": 15.07
          },
          "taxRate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Tax rate of the transaction",
            "example": 10
          },
          "taxType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tax type of the transaction",
            "example": "VAT"
          },
          "currency": {
            "type": "string",
            "description": "Currency code of the transaction in ISO 4217 format",
            "example": "USD"
          },
          "counterpartyName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the counterparty",
            "example": "Spotify AB"
          },
          "merchantName": {
            "type": [
              "string",
              "null"
            ],
            "description": "Merchant name extracted from enrichment metadata",
            "example": "Staples"
          },
          "date": {
            "type": "string",
            "description": "Date and time of the transaction in ISO 8601 format",
            "example": "2024-05-01T12:00:00.000Z"
          },
          "category": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the category",
                "example": "office-supplies"
              },
              "name": {
                "type": "string",
                "description": "Display name of the category",
                "example": "Office Supplies"
              },
              "color": {
                "type": "string",
                "description": "Hex color code associated with the category for UI display",
                "example": "#FF5733"
              },
              "taxRate": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Tax rate of the category",
                "example": 10
              },
              "taxType": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Tax type of the category",
                "example": "VAT"
              },
              "slug": {
                "type": "string",
                "description": "URL-friendly slug of the category",
                "example": "office-supplies"
              }
            },
            "required": [
              "id",
              "name",
              "color",
              "taxRate",
              "taxType",
              "slug"
            ],
            "description": "Category information assigned to the transaction for organization",
            "example": {
              "id": "office-supplies",
              "name": "Office Supplies",
              "color": "#FF5733",
              "slug": "office-supplies",
              "taxRate": 10,
              "taxType": "VAT"
            }
          },
          "status": {
            "type": "string",
            "description": "Current status of the transaction",
            "example": "completed"
          },
          "internal": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the transaction is internal (between own accounts)",
            "example": false
          },
          "recurring": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the transaction is part of a recurring series",
            "example": false
          },
          "manual": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the transaction was created manually (via API/form) rather than imported from bank connections",
            "example": false
          },
          "frequency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Frequency of the recurring transaction if applicable (weekly, monthly, annually, irregular)",
            "example": "monthly"
          },
          "isFulfilled": {
            "type": "boolean",
            "description": "Whether the transaction has been fulfilled or processed",
            "example": true
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional note or memo attached to the transaction",
            "example": "Paid with company credit card for office renovation"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {},
            "description": "Additional metadata extracted during enrichment",
            "example": {
              "categoryHint": "office-supplies",
              "confidenceScore": 0.92
            }
          },
          "metadataCompleted": {
            "type": "boolean",
            "description": "Whether metadata extraction has completed",
            "example": true
          },
          "notified": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether notifications have been sent for this transaction",
            "example": false
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the bank account",
                "example": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388"
              },
              "name": {
                "type": "string",
                "description": "Display name of the bank account",
                "example": "Company Credit Card"
              },
              "currency": {
                "type": "string",
                "description": "Currency of the bank account in ISO 4217 format",
                "example": "USD"
              },
              "connection": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Unique identifier of the bank connection",
                    "example": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the bank institution",
                    "example": "Chase Bank"
                  },
                  "logoUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "URL to the bank institution's logo image",
                    "example": "https://cdn.eigenn.io/logos/chase-bank.png"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "logoUrl"
                ],
                "description": "Bank connection information associated with the account",
                "example": {
                  "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                  "name": "Chase Bank",
                  "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                }
              }
            },
            "required": [
              "id",
              "name",
              "currency",
              "connection"
            ],
            "description": "Bank account information associated with the transaction",
            "example": {
              "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
              "name": "Company Credit Card",
              "currency": "USD",
              "connection": {
                "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                "name": "Chase Bank",
                "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
              }
            }
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the tag",
                  "example": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Display name of the tag",
                  "example": "invoice"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "Array of tags associated with the transaction for categorization and filtering",
            "example": [
              {
                "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                "name": "invoice"
              },
              {
                "id": "c8e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7c",
                "name": "travel"
              }
            ]
          },
          "attachments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the attachment",
                  "example": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388"
                },
                "path": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Array of path segments for the attachment file storage location",
                  "example": [
                    "dd6a039e-d071-423a-9a4d-9ba71325d890",
                    "transactions",
                    "1d2c3753-79d7-45b0-9c40-60f482bac8e8",
                    "receipt.pdf"
                  ]
                },
                "size": {
                  "type": "number",
                  "description": "Size of the attachment file in bytes",
                  "example": 1928716
                },
                "type": {
                  "type": "string",
                  "description": "MIME type of the attachment file",
                  "example": "application/pdf"
                },
                "filename": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Original filename of the attachment when uploaded",
                  "example": "receipt.pdf"
                }
              },
              "required": [
                "id",
                "path",
                "size",
                "type",
                "filename"
              ]
            },
            "description": "Array of file attachments associated with the transaction (receipts, invoices, etc.)",
            "example": [
              {
                "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                "path": [
                  "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                  "transactions",
                  "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                  "receipt.pdf"
                ],
                "size": 1928716,
                "type": "application/pdf",
                "filename": "receipt.pdf"
              }
            ]
          }
        },
        "required": [
          "id",
          "internalId",
          "name",
          "amount",
          "balance",
          "baseAmount",
          "baseCurrency",
          "taxAmount",
          "taxRate",
          "taxType",
          "currency",
          "counterpartyName",
          "merchantName",
          "date",
          "category",
          "status",
          "internal",
          "recurring",
          "manual",
          "frequency",
          "isFulfilled",
          "note",
          "metadata",
          "metadataCompleted",
          "notified",
          "account",
          "tags",
          "attachments"
        ],
        "description": "Transaction record with related category, account, and tags.",
        "example": {
          "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
          "internalId": "txn_20240501_001",
          "name": "Office Supplies Purchase",
          "amount": 150.75,
          "balance": 1250.55,
          "baseAmount": 150.75,
          "baseCurrency": "USD",
          "taxAmount": 15.07,
          "taxRate": 10,
          "taxType": "VAT",
          "currency": "USD",
          "counterpartyName": "Staples",
          "merchantName": "Staples",
          "date": "2024-05-01T12:00:00.000Z",
          "category": {
            "id": "office-supplies",
            "name": "Office Supplies",
            "color": "#FF5733",
            "taxRate": 10,
            "taxType": "VAT",
            "slug": "office-supplies"
          },
          "status": "completed",
          "internal": false,
          "recurring": false,
          "manual": true,
          "frequency": null,
          "isFulfilled": true,
          "note": "Paid with company credit card",
          "metadata": {
            "categoryHint": "office-supplies",
            "confidenceScore": 0.92
          },
          "metadataCompleted": true,
          "notified": false,
          "account": {
            "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
            "name": "Company Credit Card",
            "currency": "USD",
            "connection": {
              "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
              "name": "Chase Bank",
              "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
            }
          },
          "tags": [
            {
              "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
              "name": "invoice"
            }
          ],
          "attachments": [
            {
              "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
              "path": [
                "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                "transactions",
                "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                "receipt.pdf"
              ],
              "size": 1928716,
              "type": "application/pdf",
              "filename": "receipt.pdf"
            }
          ]
        }
      },
      "TagsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagResponse"
            },
            "description": "List of tags."
          }
        },
        "required": [
          "data"
        ]
      },
      "TagResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The UUID of the tag.",
            "example": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
          },
          "name": {
            "type": "string",
            "description": "The name of the tag.",
            "example": "Important"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "CreateTag": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the tag.",
            "example": "Important"
          }
        },
        "required": [
          "name"
        ]
      },
      "GetRevenueResponseSchema": {
        "type": "object",
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/RevenueSummary"
          },
          "meta": {
            "$ref": "#/components/schemas/RevenueMeta"
          },
          "result": {
            "$ref": "#/components/schemas/RevenueResultArray"
          }
        },
        "required": [
          "summary",
          "meta",
          "result"
        ]
      },
      "RevenueSummary": {
        "type": "object",
        "properties": {
          "currentTotal": {
            "type": "number",
            "description": "Total revenue for the current period",
            "example": 10000
          },
          "prevTotal": {
            "type": "number",
            "description": "Total revenue for the previous period",
            "example": 8000
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "currentTotal",
          "prevTotal",
          "currency"
        ]
      },
      "RevenueMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "revenue"
            ],
            "description": "Type of metric",
            "example": "revenue"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "type",
          "currency"
        ]
      },
      "RevenueResultArray": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/RevenueResultItem"
        }
      },
      "RevenueResultItem": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the metric (ISO 8601)",
            "example": "2023-01-31"
          },
          "percentage": {
            "$ref": "#/components/schemas/RevenuePercentage"
          },
          "current": {
            "$ref": "#/components/schemas/RevenueCurrent"
          },
          "previous": {
            "$ref": "#/components/schemas/RevenuePrevious"
          }
        },
        "required": [
          "date",
          "percentage",
          "current",
          "previous"
        ]
      },
      "RevenuePercentage": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "description": "Percentage change compared to previous period",
            "example": 25
          },
          "status": {
            "type": "string",
            "enum": [
              "negative",
              "positive"
            ],
            "description": "Status of the change",
            "example": "positive"
          }
        },
        "required": [
          "value",
          "status"
        ]
      },
      "RevenueCurrent": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the current value",
            "example": "2023-01-31"
          },
          "value": {
            "type": "number",
            "description": "Current value",
            "example": 1000
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "date",
          "value",
          "currency"
        ]
      },
      "RevenuePrevious": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the previous value",
            "example": "2022-01-31"
          },
          "value": {
            "type": "number",
            "description": "Previous value",
            "example": 800
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "date",
          "value",
          "currency"
        ]
      },
      "GetProfitResponseSchema": {
        "type": "object",
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/ProfitSummary"
          },
          "meta": {
            "$ref": "#/components/schemas/ProfitMeta"
          },
          "result": {
            "$ref": "#/components/schemas/ProfitResultArray"
          }
        },
        "required": [
          "summary",
          "meta",
          "result"
        ]
      },
      "ProfitSummary": {
        "type": "object",
        "properties": {
          "currentTotal": {
            "type": "number",
            "description": "Total profit for the current period",
            "example": 10000
          },
          "prevTotal": {
            "type": "number",
            "description": "Total profit for the previous period",
            "example": 8000
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "currentTotal",
          "prevTotal",
          "currency"
        ]
      },
      "ProfitMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "profit"
            ],
            "description": "Type of metric",
            "example": "profit"
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "type",
          "currency"
        ]
      },
      "ProfitResultArray": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ProfitResultItem"
        }
      },
      "ProfitResultItem": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the metric (ISO 8601)",
            "example": "2023-01-31"
          },
          "percentage": {
            "$ref": "#/components/schemas/ProfitPercentage"
          },
          "current": {
            "$ref": "#/components/schemas/ProfitCurrent"
          },
          "previous": {
            "$ref": "#/components/schemas/ProfitPrevious"
          }
        },
        "required": [
          "date",
          "percentage",
          "current",
          "previous"
        ]
      },
      "ProfitPercentage": {
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "description": "Percentage change compared to previous period",
            "example": 25
          },
          "status": {
            "type": "string",
            "enum": [
              "negative",
              "positive"
            ],
            "description": "Status of the change",
            "example": "positive"
          }
        },
        "required": [
          "value",
          "status"
        ]
      },
      "ProfitCurrent": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the current value",
            "example": "2023-01-31"
          },
          "value": {
            "type": "number",
            "description": "Current value",
            "example": 1000
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "date",
          "value",
          "currency"
        ]
      },
      "ProfitPrevious": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the previous value",
            "example": "2022-01-31"
          },
          "value": {
            "type": "number",
            "description": "Previous value",
            "example": 800
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "USD"
          }
        },
        "required": [
          "date",
          "value",
          "currency"
        ]
      },
      "GetBurnRateResponseSchema": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/BurnRateResultItem"
        }
      },
      "BurnRateResultItem": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Date for the burn rate value",
            "example": "2024-01-01"
          },
          "value": {
            "type": "number",
            "description": "Burn rate value for the given date",
            "example": 647366.44
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)",
            "example": "SEK"
          }
        },
        "required": [
          "date",
          "value",
          "currency"
        ]
      },
      "GetExpensesResponseSchema": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "object",
            "properties": {
              "averageExpense": {
                "type": "number",
                "description": "Average expense over the period",
                "example": 121054.86
              },
              "currency": {
                "type": "string",
                "description": "Currency code (ISO 4217)",
                "example": "SEK"
              }
            },
            "required": [
              "averageExpense",
              "currency"
            ]
          },
          "meta": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of metric",
                "example": "expense"
              },
              "currency": {
                "type": "string",
                "description": "Currency code (ISO 4217)",
                "example": "SEK"
              }
            },
            "required": [
              "type",
              "currency"
            ]
          },
          "result": {
            "$ref": "#/components/schemas/ExpensesResultArray"
          }
        },
        "required": [
          "summary",
          "meta",
          "result"
        ]
      },
      "ExpensesResultArray": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "description": "Date for the expense value",
              "example": "2024-01-01 00:00:00"
            },
            "value": {
              "type": "number",
              "description": "Expense value for the given date",
              "example": 637898.68
            },
            "currency": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "SEK"
            },
            "recurring": {
              "type": "number",
              "description": "Recurring expense value for the given date",
              "example": 9467.76
            },
            "total": {
              "type": "number",
              "description": "Total expense for the given date",
              "example": 647366.44
            }
          },
          "required": [
            "date",
            "value",
            "currency",
            "recurring",
            "total"
          ]
        }
      },
      "SpendingResultArray": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Spending category name",
              "example": "Taxes"
            },
            "slug": {
              "type": "string",
              "description": "Spending category slug",
              "example": "taxes"
            },
            "amount": {
              "type": "number",
              "description": "Amount spent in this category",
              "example": -1256445
            },
            "currency": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "SEK"
            },
            "color": {
              "type": "string",
              "description": "Color code for the category",
              "example": "#8492A6"
            },
            "percentage": {
              "type": "number",
              "description": "Percentage of total spending for this category",
              "example": 44
            }
          },
          "required": [
            "name",
            "slug",
            "amount",
            "currency",
            "color",
            "percentage"
          ]
        }
      },
      "BalancesResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/BalancesMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/BalancesSummary"
          },
          "result": {
            "$ref": "#/components/schemas/BalancesResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "BalancesMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "balances"
            ]
          },
          "currency": {
            "type": "string"
          },
          "asOf": {
            "type": "string"
          },
          "currencySource": {
            "type": "string",
            "enum": [
              "team",
              "inferred",
              "override"
            ],
            "description": "Source of currency selection"
          }
        },
        "required": [
          "type",
          "currency",
          "asOf"
        ]
      },
      "BalancesSummary": {
        "type": "object",
        "properties": {
          "totalBalance": {
            "type": "number"
          },
          "accountCount": {
            "type": "number"
          }
        },
        "required": [
          "totalBalance",
          "accountCount"
        ]
      },
      "BalancesResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "accountId": {
              "type": "string"
            },
            "accountName": {
              "type": [
                "string",
                "null"
              ]
            },
            "balance": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "accountId",
            "accountName",
            "balance",
            "currency"
          ]
        }
      },
      "CollectionsRecoveryRateResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/CollectionsRecoveryRateMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/CollectionsRecoveryRateSummary"
          },
          "result": {
            "$ref": "#/components/schemas/CollectionsRecoveryRateResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "CollectionsRecoveryRateMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "collections_recovery_rate"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currencySource": {
            "type": "string",
            "enum": [
              "team",
              "inferred",
              "override"
            ],
            "description": "Source of currency selection"
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "CollectionsRecoveryRateSummary": {
        "type": "object",
        "properties": {
          "totalInvoiced": {
            "type": "number"
          },
          "totalPaid": {
            "type": "number"
          },
          "avgRecoveryPct": {
            "type": "number"
          }
        },
        "required": [
          "totalInvoiced",
          "totalPaid",
          "avgRecoveryPct"
        ]
      },
      "CollectionsRecoveryRateResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "invoiced": {
              "type": "number"
            },
            "paid": {
              "type": "number"
            },
            "recoveryPct": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "date",
            "invoiced",
            "paid",
            "recoveryPct",
            "currency"
          ]
        }
      },
      "CollectionsFunnelResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/CollectionsFunnelMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/CollectionsFunnelSummary"
          },
          "result": {
            "$ref": "#/components/schemas/CollectionsFunnelResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "CollectionsFunnelMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "collections_funnel"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "CollectionsFunnelSummary": {
        "type": "object",
        "properties": {
          "queued": {
            "type": "number"
          },
          "sent": {
            "type": "number"
          },
          "delivered": {
            "type": "number"
          },
          "replied": {
            "type": "number"
          },
          "paid": {
            "type": "number"
          },
          "bounced": {
            "type": "number"
          },
          "failed": {
            "type": "number"
          }
        },
        "required": [
          "queued",
          "sent",
          "delivered",
          "replied",
          "paid",
          "bounced",
          "failed"
        ]
      },
      "CollectionsFunnelResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "queued": {
              "type": "number"
            },
            "sent": {
              "type": "number"
            },
            "delivered": {
              "type": "number"
            },
            "replied": {
              "type": "number"
            },
            "paid": {
              "type": "number"
            },
            "bounced": {
              "type": "number"
            },
            "failed": {
              "type": "number"
            }
          },
          "required": [
            "date",
            "queued",
            "sent",
            "delivered",
            "replied",
            "paid",
            "bounced",
            "failed"
          ]
        }
      },
      "PromisesToPayResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/PromisesToPayMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/PromisesToPaySummary"
          },
          "result": {
            "type": "array",
            "items": {},
            "default": []
          }
        },
        "required": [
          "meta",
          "summary"
        ]
      },
      "PromisesToPayMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "promises_to_pay"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "PromisesToPaySummary": {
        "type": "object",
        "properties": {
          "kept": {
            "type": "number"
          },
          "broken": {
            "type": "number"
          },
          "open": {
            "type": "number"
          },
          "canceled": {
            "type": "number"
          },
          "keptRate": {
            "type": "number"
          },
          "brokenRate": {
            "type": "number"
          }
        },
        "required": [
          "kept",
          "broken",
          "open",
          "canceled",
          "keptRate",
          "brokenRate"
        ]
      },
      "WriteOffsResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/WriteOffsMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/WriteOffsSummary"
          },
          "result": {
            "$ref": "#/components/schemas/WriteOffsResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "WriteOffsMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "write_offs"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currencySource": {
            "type": "string",
            "enum": [
              "team",
              "inferred",
              "override"
            ],
            "description": "Source of currency selection"
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "WriteOffsSummary": {
        "type": "object",
        "properties": {
          "totalAmount": {
            "type": "number"
          }
        },
        "required": [
          "totalAmount"
        ]
      },
      "WriteOffsResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "amount": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "date",
            "amount",
            "currency"
          ]
        }
      },
      "DisputesResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/DisputesMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/DisputesSummary"
          },
          "result": {
            "$ref": "#/components/schemas/DisputesResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "DisputesMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "disputes"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "DisputesSummary": {
        "type": "object",
        "properties": {
          "totalFailures": {
            "type": "number"
          }
        },
        "required": [
          "totalFailures"
        ]
      },
      "DisputesResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "failures": {
              "type": "number"
            }
          },
          "required": [
            "date",
            "failures"
          ]
        }
      },
      "TimeToCollectResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/TimeToCollectMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/TimeToCollectSummary"
          },
          "result": {
            "type": "array",
            "items": {},
            "default": []
          }
        },
        "required": [
          "meta",
          "summary"
        ]
      },
      "TimeToCollectMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "time_to_collect"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "TimeToCollectSummary": {
        "type": "object",
        "properties": {
          "avgDays": {
            "type": "number"
          },
          "p50": {
            "type": "number"
          },
          "p90": {
            "type": "number"
          }
        },
        "required": [
          "avgDays",
          "p50",
          "p90"
        ]
      },
      "PaymentMethodsResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/PaymentMethodsMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/PaymentMethodsSummary"
          },
          "result": {
            "$ref": "#/components/schemas/PaymentMethodsResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "PaymentMethodsMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "payment_methods"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "PaymentMethodsSummary": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "number"
          },
          "totalAmount": {
            "type": "number"
          }
        },
        "required": [
          "totalCount",
          "totalAmount"
        ]
      },
      "PaymentMethodsResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "method": {
              "type": [
                "string",
                "null"
              ]
            },
            "count": {
              "type": "number"
            },
            "amount": {
              "type": "number"
            }
          },
          "required": [
            "method",
            "count",
            "amount"
          ]
        }
      },
      "InvoiceStatusSummaryResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/InvoiceStatusSummaryMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/InvoiceStatusSummary"
          },
          "result": {
            "$ref": "#/components/schemas/InvoiceStatusSummaryResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "InvoiceStatusSummaryMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "invoice_status_summary"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "InvoiceStatusSummary": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "number"
          },
          "totalAmount": {
            "type": "number"
          }
        },
        "required": [
          "totalCount",
          "totalAmount"
        ]
      },
      "InvoiceStatusSummaryResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string"
            },
            "count": {
              "type": "number"
            },
            "amount": {
              "type": "number"
            }
          },
          "required": [
            "status",
            "count",
            "amount"
          ]
        }
      },
      "InvoiceAgingMovementResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/InvoiceAgingMovementMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/InvoiceAgingMovementSummary"
          },
          "result": {
            "$ref": "#/components/schemas/InvoiceAgingMovementResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "InvoiceAgingMovementMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "invoice_aging_movement"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "InvoiceAgingMovementSummary": {
        "type": "object",
        "properties": {
          "totalDelta": {
            "type": "number"
          }
        },
        "required": [
          "totalDelta"
        ]
      },
      "InvoiceAgingMovementResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "delta": {
              "type": "number"
            }
          },
          "required": [
            "bucket",
            "delta"
          ]
        }
      },
      "RevenueDiscountsResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/RevenueDiscountsMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/RevenueDiscountsSummary"
          },
          "result": {
            "$ref": "#/components/schemas/RevenueDiscountsResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "RevenueDiscountsMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "revenue_discounts"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "RevenueDiscountsSummary": {
        "type": "object",
        "properties": {
          "totalDiscountAmount": {
            "type": "number"
          },
          "totalCreditNoteAmount": {
            "type": "number"
          },
          "totalGrossRevenue": {
            "type": "number"
          },
          "totalNetRevenue": {
            "type": "number"
          }
        },
        "required": [
          "totalDiscountAmount",
          "totalCreditNoteAmount",
          "totalGrossRevenue",
          "totalNetRevenue"
        ]
      },
      "RevenueDiscountsResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "discountAmount": {
              "type": "number"
            },
            "creditNoteAmount": {
              "type": "number"
            },
            "grossRevenue": {
              "type": "number"
            },
            "netRevenue": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "date",
            "discountAmount",
            "creditNoteAmount",
            "grossRevenue",
            "netRevenue",
            "currency"
          ]
        }
      },
      "RevenueByProductResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/RevenueByProductMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/RevenueByProductSummary"
          },
          "result": {
            "$ref": "#/components/schemas/RevenueByProductResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "RevenueByProductMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "revenue_by_product"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "RevenueByProductSummary": {
        "type": "object",
        "properties": {
          "totalRevenue": {
            "type": "number"
          },
          "categoryCount": {
            "type": "number"
          }
        },
        "required": [
          "totalRevenue",
          "categoryCount"
        ]
      },
      "RevenueByProductResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "category": {
              "type": "string"
            },
            "amount": {
              "type": "number"
            },
            "pct": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "category",
            "amount",
            "pct",
            "currency"
          ]
        }
      },
      "ProfitByCategoryResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/ProfitByCategoryMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/ProfitByCategorySummary"
          },
          "result": {
            "$ref": "#/components/schemas/ProfitByCategoryResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "ProfitByCategoryMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "profit_by_category"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "ProfitByCategorySummary": {
        "type": "object",
        "properties": {
          "totalRevenue": {
            "type": "number"
          },
          "totalCost": {
            "type": "number"
          },
          "totalProfit": {
            "type": "number"
          },
          "avgMarginPct": {
            "type": "number"
          }
        },
        "required": [
          "totalRevenue",
          "totalCost",
          "totalProfit",
          "avgMarginPct"
        ]
      },
      "ProfitByCategoryResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "category": {
              "type": "string"
            },
            "revenue": {
              "type": "number"
            },
            "cost": {
              "type": "number"
            },
            "profit": {
              "type": "number"
            },
            "marginPct": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "category",
            "revenue",
            "cost",
            "profit",
            "marginPct",
            "currency"
          ]
        }
      },
      "ProfitByCustomerResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/ProfitByCustomerMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/ProfitByCustomerSummary"
          },
          "result": {
            "$ref": "#/components/schemas/ProfitByCustomerResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "ProfitByCustomerMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "profit_by_customer"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "ProfitByCustomerSummary": {
        "type": "object",
        "properties": {
          "totalRevenue": {
            "type": "number"
          },
          "totalCost": {
            "type": "number"
          },
          "totalProfit": {
            "type": "number"
          },
          "customerCount": {
            "type": "number"
          },
          "avgMarginPct": {
            "type": "number"
          }
        },
        "required": [
          "totalRevenue",
          "totalCost",
          "totalProfit",
          "customerCount",
          "avgMarginPct"
        ]
      },
      "ProfitByCustomerResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "customerId": {
              "type": "string"
            },
            "customerName": {
              "type": "string"
            },
            "revenue": {
              "type": "number"
            },
            "cost": {
              "type": "number"
            },
            "profit": {
              "type": "number"
            },
            "marginPct": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "customerId",
            "customerName",
            "revenue",
            "cost",
            "profit",
            "marginPct",
            "currency"
          ]
        }
      },
      "CashFlowResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "cash_flow"
                ]
              },
              "currency": {
                "type": "string"
              },
              "period": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              },
              "granularity": {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "quarter",
                  "year"
                ],
                "description": "Time granularity for bucketed series"
              }
            },
            "required": [
              "type",
              "currency",
              "period",
              "granularity"
            ]
          },
          "summary": {
            "type": "object",
            "properties": {
              "totalInflow": {
                "type": "number"
              },
              "totalOutflow": {
                "type": "number"
              },
              "net": {
                "type": "number"
              }
            },
            "required": [
              "totalInflow",
              "totalOutflow",
              "net"
            ]
          },
          "result": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "inflow": {
                  "type": "number"
                },
                "outflow": {
                  "type": "number"
                },
                "net": {
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "date",
                "inflow",
                "outflow",
                "net",
                "currency"
              ]
            }
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "RevenueByCustomerResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/RevenueByCustomerMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/RevenueByCustomerSummary"
          },
          "result": {
            "$ref": "#/components/schemas/RevenueByCustomerResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "RevenueByCustomerMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "revenue_by_customer"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "RevenueByCustomerSummary": {
        "type": "object",
        "properties": {
          "totalRevenue": {
            "type": "number"
          },
          "customerCount": {
            "type": "number"
          }
        },
        "required": [
          "totalRevenue",
          "customerCount"
        ]
      },
      "RevenueByCustomerResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "customerId": {
              "type": "string"
            },
            "customerName": {
              "type": "string"
            },
            "amount": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "customerId",
            "customerName",
            "amount",
            "currency"
          ]
        }
      },
      "ProfitMarginResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/ProfitMarginMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/ProfitMarginSummary"
          },
          "result": {
            "$ref": "#/components/schemas/ProfitMarginResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "ProfitMarginMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "profit_margin"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "ProfitMarginSummary": {
        "type": "object",
        "properties": {
          "lastMarginPct": {
            "type": "number"
          },
          "avgMarginPct": {
            "type": "number"
          }
        },
        "required": [
          "lastMarginPct",
          "avgMarginPct"
        ]
      },
      "ProfitMarginResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "profit": {
              "type": "number"
            },
            "revenue": {
              "type": "number"
            },
            "marginPct": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "date",
            "profit",
            "revenue",
            "marginPct",
            "currency"
          ]
        }
      },
      "GrowthRateResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/GrowthRateMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/GrowthRateSummary"
          },
          "result": {
            "$ref": "#/components/schemas/GrowthRateResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "GrowthRateMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "growth_rate"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "window": {
            "type": "string",
            "enum": [
              "mom",
              "yoy"
            ]
          },
          "metricType": {
            "type": "string",
            "enum": [
              "revenue",
              "profit"
            ]
          }
        },
        "required": [
          "type",
          "period",
          "window",
          "metricType"
        ]
      },
      "GrowthRateSummary": {
        "type": "object",
        "properties": {
          "lastRate": {
            "type": "number"
          },
          "avgRate": {
            "type": "number"
          }
        },
        "required": [
          "lastRate",
          "avgRate"
        ]
      },
      "GrowthRateResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "rate": {
              "type": "number"
            }
          },
          "required": [
            "date",
            "rate"
          ]
        }
      },
      "RecurringVsOneOffResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/RecurringVsOneOffMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/RecurringVsOneOffSummary"
          },
          "result": {
            "$ref": "#/components/schemas/RecurringVsOneOffResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "RecurringVsOneOffMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "recurring_vs_oneoff"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "description": "Time granularity for bucketed series"
          }
        },
        "required": [
          "type",
          "currency",
          "period",
          "granularity"
        ]
      },
      "RecurringVsOneOffSummary": {
        "type": "object",
        "properties": {
          "totalRecurring": {
            "type": "number"
          },
          "totalOneOff": {
            "type": "number"
          },
          "total": {
            "type": "number"
          }
        },
        "required": [
          "totalRecurring",
          "totalOneOff",
          "total"
        ]
      },
      "RecurringVsOneOffResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string"
            },
            "recurring": {
              "type": "number"
            },
            "oneOff": {
              "type": "number"
            },
            "total": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "date",
            "recurring",
            "oneOff",
            "total",
            "currency"
          ]
        }
      },
      "SeasonalityResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/SeasonalityMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/SeasonalitySummary"
          },
          "result": {
            "$ref": "#/components/schemas/SeasonalityResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "SeasonalityMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "revenue_seasonality"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "SeasonalitySummary": {
        "type": "object",
        "properties": {
          "minFactor": {
            "type": "number"
          },
          "maxFactor": {
            "type": "number"
          },
          "avgFactor": {
            "type": "number"
          }
        },
        "required": [
          "minFactor",
          "maxFactor",
          "avgFactor"
        ]
      },
      "SeasonalityResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "month": {
              "type": "number"
            },
            "factor": {
              "type": "number"
            }
          },
          "required": [
            "month",
            "factor"
          ]
        }
      },
      "RevenueVolatilityResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/RevenueVolatilityMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/RevenueVolatilitySummary"
          },
          "result": {
            "type": "array",
            "items": {},
            "default": []
          }
        },
        "required": [
          "meta",
          "summary"
        ]
      },
      "RevenueVolatilityMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "revenue_volatility"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "description": "Time granularity for bucketed series"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "period",
          "granularity"
        ]
      },
      "RevenueVolatilitySummary": {
        "type": "object",
        "properties": {
          "stdDev": {
            "type": "number"
          },
          "mean": {
            "type": "number"
          },
          "covPct": {
            "type": "number"
          }
        },
        "required": [
          "stdDev",
          "mean",
          "covPct"
        ]
      },
      "CustomersConcentrationResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/CustomersConcentrationMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/CustomersConcentrationSummary"
          },
          "result": {
            "$ref": "#/components/schemas/CustomersConcentrationResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "CustomersConcentrationMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "customers_concentration"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "CustomersConcentrationSummary": {
        "type": "object",
        "properties": {
          "hhi": {
            "type": "number"
          },
          "topSharePct": {
            "type": "number"
          }
        },
        "required": [
          "hhi",
          "topSharePct"
        ]
      },
      "CustomersConcentrationResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "customerId": {
              "type": "string"
            },
            "customerName": {
              "type": "string"
            },
            "amount": {
              "type": "number"
            },
            "pct": {
              "type": "number"
            }
          },
          "required": [
            "customerId",
            "customerName",
            "amount",
            "pct"
          ]
        }
      },
      "CustomersGeographyResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/CustomersGeographyMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/CustomersGeographySummary"
          },
          "result": {
            "$ref": "#/components/schemas/CustomersGeographyResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "CustomersGeographyMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "customers_geography"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "period",
          "currency"
        ]
      },
      "CustomersGeographySummary": {
        "type": "object",
        "properties": {
          "totalAmount": {
            "type": "number"
          },
          "countryCount": {
            "type": "number"
          }
        },
        "required": [
          "totalAmount",
          "countryCount"
        ]
      },
      "CustomersGeographyResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "country": {
              "type": [
                "string",
                "null"
              ]
            },
            "amount": {
              "type": "number"
            },
            "pct": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "country",
            "amount",
            "pct",
            "currency"
          ]
        }
      },
      "CustomersPaymentBehaviorResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/CustomersPaymentBehaviorMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/CustomersPaymentBehaviorSummary"
          },
          "result": {
            "$ref": "#/components/schemas/CustomersPaymentBehaviorResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "CustomersPaymentBehaviorMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "customers_payment_behavior"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "CustomersPaymentBehaviorSummary": {
        "type": "object",
        "properties": {
          "avgDaysLate": {
            "type": "number"
          },
          "avgPercentLate": {
            "type": "number"
          },
          "customerCount": {
            "type": "number"
          }
        },
        "required": [
          "avgDaysLate",
          "avgPercentLate",
          "customerCount"
        ]
      },
      "CustomersPaymentBehaviorResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "customerId": {
              "type": "string"
            },
            "avgDaysLate": {
              "type": "number"
            },
            "percentLate": {
              "type": "number"
            },
            "avgInvoiceAmount": {
              "type": "number"
            }
          },
          "required": [
            "customerId",
            "avgDaysLate",
            "percentLate",
            "avgInvoiceAmount"
          ]
        }
      },
      "CashBalanceResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "cash_balance"
                ]
              },
              "currency": {
                "type": "string"
              },
              "period": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              },
              "granularity": {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month",
                  "quarter",
                  "year"
                ],
                "description": "Time granularity for bucketed series"
              }
            },
            "required": [
              "type",
              "currency",
              "period",
              "granularity"
            ]
          },
          "summary": {
            "$ref": "#/components/schemas/CashBalanceSummary"
          },
          "result": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "balance": {
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "date",
                "balance",
                "currency"
              ]
            }
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "CashBalanceSummary": {
        "type": "object",
        "properties": {
          "startingBalance": {
            "type": "number"
          },
          "endingBalance": {
            "type": "number"
          }
        },
        "required": [
          "startingBalance",
          "endingBalance"
        ]
      },
      "KpisResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string"
              },
              "period": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              }
            },
            "required": [
              "currency",
              "period"
            ]
          },
          "result": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "meta",
          "result"
        ]
      },
      "InvoiceAgingResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invoice_aging"
                ]
              },
              "currency": {
                "type": "string"
              },
              "asOf": {
                "type": "string"
              },
              "buckets": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "required": [
              "type",
              "currency",
              "asOf",
              "buckets"
            ]
          },
          "summary": {
            "type": "object",
            "properties": {
              "totalOutstanding": {
                "type": "number"
              },
              "overdueAmount": {
                "type": "number"
              }
            },
            "required": [
              "totalOutstanding",
              "overdueAmount"
            ]
          },
          "result": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "count": {
                  "type": "number"
                },
                "amount": {
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "bucket",
                "count",
                "amount"
              ]
            }
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "StressTestResponse": {
        "type": "object",
        "properties": {
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "inflow": {
                  "type": "number"
                },
                "outflow": {
                  "type": "number"
                },
                "net": {
                  "type": "number"
                },
                "balance": {
                  "type": "number"
                },
                "ciLow": {
                  "type": "number"
                },
                "ciHigh": {
                  "type": "number"
                }
              },
              "required": [
                "date",
                "inflow",
                "outflow",
                "net",
                "balance"
              ]
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "monthsOfRunway": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "minBalance": {
                "type": "number"
              },
              "minBalanceMonth": {
                "type": "string"
              },
              "breachDate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "probOfBreach": {
                "type": "number"
              }
            },
            "required": [
              "monthsOfRunway",
              "minBalance",
              "minBalanceMonth",
              "breachDate"
            ]
          }
        },
        "required": [
          "series",
          "summary"
        ]
      },
      "StressTestRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "horizonMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 24
          },
          "currency": {
            "type": "string"
          },
          "startingCash": {
            "type": "number"
          },
          "drivers": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "RevenueShock"
                      ]
                    },
                    "pct": {
                      "type": "number",
                      "description": "Percentage shock, negative for drop"
                    },
                    "months": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "startOffset": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "type",
                    "pct",
                    "months"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "CollectionDelay"
                      ]
                    },
                    "days": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 180
                    }
                  },
                  "required": [
                    "type",
                    "days"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "ExpenseSurge"
                      ]
                    },
                    "pct": {
                      "type": "number"
                    },
                    "months": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "startMonthOffset": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "type",
                    "pct"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "OneTimeExpense"
                      ]
                    },
                    "amount": {
                      "type": "number",
                      "minimum": 0
                    },
                    "date": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "amount",
                    "date"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "HiringPlan"
                      ]
                    },
                    "headcountDelta": {
                      "type": "integer"
                    },
                    "monthlyCostPerHead": {
                      "type": "number",
                      "minimum": 0
                    },
                    "startMonthOffset": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "rampMonths": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "type",
                    "headcountDelta",
                    "monthlyCostPerHead"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "FxShock"
                      ]
                    },
                    "pairs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "from": {
                            "type": "string"
                          },
                          "delta": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "from",
                          "delta"
                        ]
                      }
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "spot",
                        "sticky"
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "pairs"
                  ]
                }
              ]
            },
            "default": []
          }
        },
        "required": [
          "from",
          "to",
          "horizonMonths"
        ]
      },
      "ForecastResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "cash_flow",
                  "revenue"
                ]
              },
              "currency": {
                "type": "string"
              },
              "period": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              },
              "horizonMonths": {
                "type": "integer"
              }
            },
            "required": [
              "type",
              "currency",
              "period",
              "horizonMonths"
            ]
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                },
                "ciLow": {
                  "type": "number"
                },
                "ciHigh": {
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "date",
                "value",
                "ciLow",
                "ciHigh",
                "currency"
              ]
            }
          }
        },
        "required": [
          "meta",
          "series"
        ]
      },
      "ForecastRequest": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "Training start date",
            "example": "2023-01-01"
          },
          "to": {
            "type": "string",
            "description": "Training end date",
            "example": "2024-01-01"
          },
          "horizonMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60,
            "description": "Forecast horizon in months",
            "example": 12
          },
          "currency": {
            "type": "string",
            "description": "Currency code (ISO 4217)"
          }
        },
        "required": [
          "from",
          "to",
          "horizonMonths"
        ]
      },
      "GetRunwayResponseSchema": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/RunwayMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/RunwaySummary"
          },
          "result": {
            "$ref": "#/components/schemas/RunwayResult"
          }
        },
        "required": [
          "meta",
          "summary"
        ]
      },
      "RunwayMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "runway"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currencySource": {
            "type": "string",
            "enum": [
              "team",
              "inferred",
              "override"
            ],
            "description": "Source of currency selection"
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "RunwaySummary": {
        "type": "object",
        "properties": {
          "months": {
            "type": "number",
            "description": "Months remaining"
          }
        },
        "required": [
          "months"
        ]
      },
      "RunwayResult": {
        "type": "array",
        "items": {},
        "default": []
      },
      "GetSpendingResponseSchema": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/SpendingMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/SpendingSummary"
          },
          "result": {
            "$ref": "#/components/schemas/SpendingResultArray"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "SpendingMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "spending"
            ]
          },
          "currency": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currencySource": {
            "type": "string",
            "enum": [
              "team",
              "inferred",
              "override"
            ],
            "description": "Source of currency selection"
          }
        },
        "required": [
          "type",
          "currency",
          "period"
        ]
      },
      "SpendingSummary": {
        "type": "object",
        "properties": {
          "totalAmount": {
            "type": "number",
            "description": "Total amount across categories"
          },
          "categoryCount": {
            "type": "number",
            "description": "Number of categories"
          }
        },
        "required": [
          "totalAmount",
          "categoryCount"
        ]
      },
      "TransactionsTimeseriesResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/TransactionsTimeseriesMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/TransactionsTimeseriesSummary"
          },
          "result": {
            "$ref": "#/components/schemas/TransactionsTimeseriesResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "TransactionsTimeseriesMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "transactions_timeseries"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "description": "Time granularity for bucketed series"
          },
          "kind": {
            "type": "string",
            "enum": [
              "net",
              "inflow",
              "outflow",
              "count"
            ]
          },
          "currency": {
            "type": "string"
          },
          "currencySource": {
            "type": "string",
            "enum": [
              "team",
              "inferred",
              "override"
            ],
            "description": "Source of currency selection"
          }
        },
        "required": [
          "type",
          "period",
          "granularity"
        ]
      },
      "TransactionsTimeseriesSummary": {
        "type": "object",
        "properties": {
          "totalValue": {
            "type": "number"
          }
        },
        "required": [
          "totalValue"
        ]
      },
      "TransactionsTimeseriesResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "description": "Bucket date",
              "example": "2023-01-31"
            },
            "value": {
              "type": "number",
              "description": "Value for bucket",
              "example": 1234.56
            },
            "currency": {
              "type": "string",
              "description": "Currency code",
              "example": "USD"
            }
          },
          "required": [
            "date",
            "value",
            "currency"
          ]
        }
      },
      "InvoiceStatusTimeseriesResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/InvoiceStatusTimeseriesMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/InvoiceStatusTimeseriesSummary"
          },
          "result": {
            "$ref": "#/components/schemas/InvoiceStatusTimeseriesResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "InvoiceStatusTimeseriesMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "invoice_status_timeseries"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "description": "Time granularity for bucketed series"
          }
        },
        "required": [
          "type",
          "period",
          "granularity"
        ]
      },
      "InvoiceStatusTimeseriesSummary": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "number"
          },
          "totalAmount": {
            "type": "number"
          }
        },
        "required": [
          "totalCount",
          "totalAmount"
        ]
      },
      "InvoiceStatusTimeseriesResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "date": {
              "type": "string",
              "description": "Bucket date",
              "example": "2023-01-31"
            },
            "status": {
              "type": "string",
              "description": "Invoice status",
              "example": "paid"
            },
            "count": {
              "type": "number",
              "description": "Count in bucket",
              "example": 42
            },
            "amount": {
              "type": "number",
              "description": "Total amount in bucket",
              "example": 98765.43
            }
          },
          "required": [
            "date",
            "status",
            "count",
            "amount"
          ]
        }
      },
      "TopMerchantsResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/TopMerchantsMeta"
          },
          "summary": {
            "$ref": "#/components/schemas/TopMerchantsSummary"
          },
          "result": {
            "$ref": "#/components/schemas/TopMerchantsResult"
          }
        },
        "required": [
          "meta",
          "summary",
          "result"
        ]
      },
      "TopMerchantsMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "top_merchants"
            ]
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "period"
        ]
      },
      "TopMerchantsSummary": {
        "type": "object",
        "properties": {
          "totalAmount": {
            "type": "number"
          },
          "totalTransactions": {
            "type": "number"
          }
        },
        "required": [
          "totalAmount",
          "totalTransactions"
        ]
      },
      "TopMerchantsResult": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "merchantName": {
              "type": "string",
              "description": "Merchant name",
              "example": "Acme Inc."
            },
            "amount": {
              "type": "number",
              "description": "Total amount",
              "example": 12345.67
            },
            "txCount": {
              "type": "number",
              "description": "Transaction count",
              "example": 12
            },
            "currency": {
              "type": "string",
              "description": "Currency",
              "example": "USD"
            }
          },
          "required": [
            "merchantName",
            "amount",
            "txCount",
            "currency"
          ]
        }
      },
      "GetTaxSummaryResponseSchema": {
        "type": "object",
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/TaxSummarySummary"
          },
          "meta": {
            "$ref": "#/components/schemas/TaxSummaryMeta"
          },
          "result": {
            "$ref": "#/components/schemas/TaxSummaryRows"
          }
        },
        "required": [
          "summary",
          "meta",
          "result"
        ]
      },
      "TaxSummarySummary": {
        "type": "object",
        "properties": {
          "totalTaxAmount": {
            "type": "number",
            "description": "Total tax amount",
            "example": 1234.56
          },
          "totalTransactionAmount": {
            "type": "number",
            "description": "Total transaction amount",
            "example": 54321.98
          },
          "totalTransactions": {
            "type": "number",
            "description": "Transaction count",
            "example": 120
          },
          "categoryCount": {
            "type": "number",
            "description": "Number of categories",
            "example": 8
          },
          "type": {
            "type": "string",
            "enum": [
              "paid",
              "collected"
            ],
            "description": "Tax direction"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "example": "USD"
          }
        },
        "required": [
          "totalTaxAmount",
          "totalTransactionAmount",
          "totalTransactions",
          "categoryCount",
          "type",
          "currency"
        ]
      },
      "TaxSummaryMeta": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tax"
            ],
            "description": "Meta type"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "paid",
              "collected"
            ],
            "description": "Tax direction"
          },
          "currency": {
            "type": "string",
            "description": "Currency code",
            "example": "USD"
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "description": "Requested period"
          }
        },
        "required": [
          "type",
          "taxType",
          "currency",
          "period"
        ]
      },
      "TaxSummaryRows": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "category_slug": {
              "type": "string"
            },
            "category_name": {
              "type": "string"
            },
            "total_tax_amount": {
              "type": "number"
            },
            "total_transaction_amount": {
              "type": "number"
            },
            "transaction_count": {
              "type": "number"
            },
            "avg_tax_rate": {
              "type": "number"
            },
            "tax_type": {
              "type": [
                "string",
                "null"
              ]
            },
            "currency": {
              "type": "string"
            },
            "earliest_date": {
              "type": "string"
            },
            "latest_date": {
              "type": "string"
            }
          },
          "required": [
            "category_slug",
            "category_name",
            "total_tax_amount",
            "total_transaction_amount",
            "transaction_count",
            "avg_tax_rate",
            "currency",
            "earliest_date",
            "latest_date"
          ]
        }
      },
      "CategoryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the category",
            "example": "cat_abc123"
          },
          "name": {
            "type": "string",
            "description": "Name of the transaction category",
            "example": "Office Supplies"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL-friendly slug for the category",
            "example": "office-supplies"
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "description": "Color code for the category",
            "example": "#FF5733"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description of the category",
            "example": "Expenses related to office supplies and equipment"
          },
          "system": {
            "type": "boolean",
            "description": "Whether this is a system-defined category",
            "example": false
          },
          "taxRate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Tax rate applicable to this category",
            "example": 0.15
          },
          "taxType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Type of tax applicable",
            "example": "VAT"
          },
          "taxReportingCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tax reporting code for this category",
            "example": "TAX-001"
          },
          "excluded": {
            "type": "boolean",
            "default": false,
            "description": "Whether this category is excluded from analytics and reports. Categories like 'Internal Transfer' are excluded by default to prevent skewing financial metrics.",
            "example": false
          },
          "parentId": {
            "type": [
              "string",
              "null"
            ],
            "description": "ID of the parent category if this is a subcategory",
            "example": "cat_parent123"
          },
          "createdAt": {
            "type": "string",
            "description": "Date and time when the category was created (ISO 8601)",
            "example": "2024-05-01T12:34:56.789Z"
          },
          "children": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Nested transaction category reference. The published OpenAPI schema keeps nested categories shallow so documentation renderers do not recurse indefinitely.",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the category",
                  "example": "cat_child123"
                },
                "name": {
                  "type": "string",
                  "description": "Name of the transaction category",
                  "example": "Printer Paper"
                },
                "slug": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "URL-friendly slug for the category",
                  "example": "printer-paper"
                },
                "color": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Color code for the category",
                  "example": "#FF5733"
                },
                "description": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Description of the category",
                  "example": "Paper and printing supplies"
                },
                "system": {
                  "type": "boolean",
                  "description": "Whether this is a system-defined category",
                  "example": false
                },
                "taxRate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Tax rate applicable to this category",
                  "example": 0.15
                },
                "taxType": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Type of tax applicable",
                  "example": "VAT"
                },
                "taxReportingCode": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Tax reporting code for this category",
                  "example": "TAX-001"
                },
                "excluded": {
                  "type": "boolean",
                  "description": "Whether this category is excluded from analytics and reports.",
                  "example": false
                },
                "parentId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ID of the parent category if this is a subcategory",
                  "example": "cat_parent123"
                },
                "createdAt": {
                  "type": "string",
                  "description": "Date and time when the category was created (ISO 8601)",
                  "example": "2024-05-01T12:34:56.789Z"
                }
              },
              "required": [
                "id",
                "name",
                "slug",
                "color",
                "description",
                "system",
                "taxRate",
                "taxType",
                "taxReportingCode",
                "excluded",
                "parentId"
              ]
            },
            "description": "Child categories if this is a parent category"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "color",
          "description",
          "system",
          "taxRate",
          "taxType",
          "taxReportingCode",
          "parentId"
        ],
        "description": "Transaction category object, including hierarchy metadata.",
        "example": {
          "id": "cat_abc123",
          "name": "Office Supplies",
          "slug": "office-supplies",
          "color": "#FF5733",
          "description": "Expenses related to office supplies and equipment",
          "system": false,
          "taxRate": 0.15,
          "taxType": "VAT",
          "taxReportingCode": "TAX-001",
          "excluded": false,
          "parentId": null,
          "createdAt": "2024-05-01T12:34:56.789Z",
          "children": []
        }
      },
      "TrackerProjectsResponse": {
        "type": "object",
        "properties": {
          "meta": {
            "type": "object",
            "properties": {
              "hasNextPage": {
                "type": "boolean",
                "description": "Whether there are more projects available on the next page",
                "example": true
              },
              "hasPreviousPage": {
                "type": "boolean",
                "description": "Whether there are more projects available on the previous page",
                "example": false
              }
            },
            "required": [
              "hasNextPage",
              "hasPreviousPage"
            ],
            "description": "Pagination metadata for the projects response"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackerProjectResponse"
            },
            "description": "Array of tracker projects matching the query criteria"
          }
        },
        "required": [
          "meta",
          "data"
        ]
      },
      "TrackerProjectResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the project",
            "example": "b7e6c8e2-1f2a-4c3b-9e2d-1a2b3c4d5e6f"
          },
          "name": {
            "type": "string",
            "description": "Name of the project",
            "example": "Website Redesign"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Detailed description of the project",
            "example": "Complete redesign of the company website with modern UI/UX and improved performance"
          },
          "status": {
            "type": "string",
            "enum": [
              "in_progress",
              "completed"
            ],
            "description": "Current status of the project",
            "example": "in_progress"
          },
          "estimate": {
            "type": [
              "number",
              "null"
            ],
            "description": "Estimated total hours required to complete the project",
            "example": 120
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Currency code for the project rate in ISO 4217 format",
            "example": "USD"
          },
          "createdAt": {
            "type": "string",
            "description": "Date and time when the project was created in ISO 8601 format",
            "example": "2024-05-01T12:00:00.000Z"
          },
          "totalDuration": {
            "type": [
              "number",
              "null"
            ],
            "description": "Total tracked time for the project in seconds",
            "example": 43200
          },
          "totalAmount": {
            "type": "number",
            "description": "Total monetary amount earned from the project",
            "example": 3600
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "Unique identifier of the customer",
                "example": "a1b2c3d4-e5f6-7890-abcd-1234567890ef"
              },
              "name": {
                "type": "string",
                "description": "Name of the customer or organization",
                "example": "Acme Corporation"
              },
              "website": {
                "type": "string",
                "description": "Website URL of the customer",
                "example": "https://acme.com"
              }
            },
            "required": [
              "id",
              "name",
              "website"
            ],
            "description": "Customer information associated with the project"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Unique identifier of the tag",
                  "example": "d1e2f3a4-b5c6-7890-abcd-1234567890ef"
                },
                "name": {
                  "type": "string",
                  "description": "Display name of the tag",
                  "example": "Design"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "Array of tags associated with the project"
          },
          "users": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Unique identifier of the user",
                  "example": "f1e2d3c4-b5a6-7890-abcd-1234567890ef"
                },
                "fullName": {
                  "type": "string",
                  "description": "Full name of the user",
                  "example": "Jane Doe"
                },
                "avatarUrl": {
                  "type": "string",
                  "format": "uri",
                  "description": "URL to the user's avatar image",
                  "example": "https://cdn.eigenn.io/avatar.jpg"
                }
              },
              "required": [
                "id",
                "fullName",
                "avatarUrl"
              ]
            },
            "description": "Array of users assigned to work on the project"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "status",
          "estimate",
          "currency",
          "createdAt",
          "totalDuration",
          "totalAmount",
          "customer",
          "tags",
          "users"
        ]
      },
      "ChatStreamResponse": {
        "type": "string",
        "description": "Server-sent event stream containing UI chat messages, tool events, and sources.",
        "example": "event: message\ndata: {\"type\":\"text-delta\",\"text\":\"Hello\"}\n\n"
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "description": "Optional deduplication key for authenticated write requests. Reusing the same key for the same mutation returns the original successful response when available.",
        "in": "header",
        "name": "Idempotency-Key",
        "required": false,
        "schema": {
          "maxLength": 128,
          "type": "string"
        }
      }
    }
  },
  "paths": {
    "/oauth/authorize": {
      "get": {
        "summary": "OAuth Authorization Endpoint",
        "operationId": "getOAuthAuthorization",
        "description": "Initiate the OAuth 2.0 authorization flow. Validates the client_id, redirect_uri, and requested scopes against the registered application. Returns application metadata for rendering a consent screen. Public clients must include a PKCE code_challenge. Rate-limited to 10 requests per 15 minutes per IP.",
        "tags": [
          "OAuth"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Client ID of the OAuth application",
              "example": "mid_client_abcdef123456789"
            },
            "required": true,
            "description": "Client ID of the OAuth application",
            "name": "client_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Code challenge for PKCE",
              "example": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM"
            },
            "required": false,
            "description": "Code challenge for PKCE",
            "name": "code_challenge",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uri",
              "description": "Redirect URI for OAuth callback",
              "example": "https://myapp.com/callback"
            },
            "required": true,
            "description": "Redirect URI for OAuth callback",
            "name": "redirect_uri",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ],
              "description": "OAuth response type, must be 'code'",
              "example": "code"
            },
            "required": true,
            "description": "OAuth response type, must be 'code'",
            "name": "response_type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Space-separated list of requested scopes",
              "example": "transactions.read invoices.read"
            },
            "required": true,
            "description": "Space-separated list of requested scopes",
            "name": "scope",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 32,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_.-]+$",
              "description": "State parameter for CSRF protection (min 32 chars, alphanumeric + _.-)",
              "example": "abc123xyz789_secure-random-state-value-with-sufficient-entropy"
            },
            "required": true,
            "description": "State parameter for CSRF protection (min 32 chars, alphanumeric + _.-)",
            "name": "state",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Application information for consent screen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Application ID",
                      "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "clientId": {
                      "type": "string",
                      "description": "Client ID",
                      "example": "mid_client_abcdef123456789"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Application description",
                      "example": "A Raycast extension for managing transactions"
                    },
                    "developerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The person or company developing this application",
                      "example": "Acme Corp"
                    },
                    "installUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An optional URL for installing the application",
                      "example": "https://myapp.com/install"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Application logo URL",
                      "example": "https://example.com/logo.png"
                    },
                    "name": {
                      "type": "string",
                      "description": "Application name",
                      "example": "My Raycast Extension"
                    },
                    "overview": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Application overview",
                      "example": "This application provides advanced transaction management features including:\n- Real-time sync\n- Advanced filtering"
                    },
                    "redirectUri": {
                      "type": "string",
                      "format": "uri",
                      "description": "Redirect URI",
                      "example": "https://myapp.com/callback"
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Requested scopes",
                      "example": [
                        "transactions.read",
                        "invoices.read"
                      ]
                    },
                    "screenshots": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      },
                      "description": "Up to 4 screenshots that will be displayed on the apps page",
                      "example": [
                        "https://example.com/screenshot1.png",
                        "https://example.com/screenshot2.png"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "minLength": 32,
                      "maxLength": 512,
                      "pattern": "^[A-Za-z0-9_.-]+$",
                      "description": "State parameter (min 32 chars, alphanumeric + _.-)",
                      "example": "abc123xyz789_secure-random-state-value-with-sufficient-entropy"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "description": "Application verification status",
                      "example": "approved"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Application website",
                      "example": "https://myapp.com"
                    }
                  },
                  "required": [
                    "id",
                    "clientId",
                    "description",
                    "developerName",
                    "installUrl",
                    "logoUrl",
                    "name",
                    "overview",
                    "redirectUri",
                    "scopes",
                    "screenshots",
                    "status",
                    "website"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error code",
                      "example": "invalid_request"
                    },
                    "error_description": {
                      "type": "string",
                      "description": "Human-readable error description",
                      "example": "The request is missing a required parameter"
                    },
                    "error_uri": {
                      "type": "string",
                      "format": "uri",
                      "description": "URI to a human-readable error page",
                      "example": "https://docs.eigenn.io/errors/invalid_request"
                    },
                    "state": {
                      "type": "string",
                      "minLength": 32,
                      "maxLength": 512,
                      "pattern": "^[A-Za-z0-9_.-]+$",
                      "description": "State parameter from the original request (min 32 chars, alphanumeric + _.-)",
                      "example": "abc123xyz789_secure-random-state-value-with-sufficient-entropy"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "OAuth Authorization Decision",
        "operationId": "postOAuthAuthorization",
        "description": "Process the user's authorization decision (allow or deny). On allow, creates an authorization code and returns a redirect URL with the code and optional state. On deny, returns a redirect with an access_denied error. Validates team membership, scopes, and PKCE requirements. Sends an app-installed email on first authorization. Requires Bearer token authentication.",
        "tags": [
          "OAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "Client ID of the OAuth application",
                    "example": "mid_client_abcdef123456789"
                  },
                  "code_challenge": {
                    "type": "string",
                    "description": "Code challenge for PKCE (S256 method assumed)",
                    "example": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM"
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "allow",
                      "deny"
                    ],
                    "description": "User's authorization decision",
                    "example": "allow"
                  },
                  "redirect_uri": {
                    "type": "string",
                    "format": "uri",
                    "description": "Redirect URI for OAuth callback",
                    "example": "https://myapp.com/callback"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "bank-accounts.read",
                        "bank-accounts.write",
                        "chat.read",
                        "chat.write",
                        "customers.read",
                        "customers.write",
                        "documents.read",
                        "documents.write",
                        "inbox.read",
                        "inbox.write",
                        "invoices.read",
                        "invoices.write",
                        "metrics.read",
                        "metrics.write",
                        "reports.read",
                        "reports.write",
                        "search.read",
                        "tags.read",
                        "tags.write",
                        "teams.read",
                        "teams.write",
                        "tracker-entries.read",
                        "tracker-entries.write",
                        "tracker-projects.read",
                        "tracker-projects.write",
                        "transactions.read",
                        "transactions.write",
                        "users.read",
                        "users.write",
                        "notifications.read",
                        "notifications.write",
                        "apis.all",
                        "apis.read"
                      ]
                    },
                    "description": "Scopes the user has approved",
                    "example": [
                      "transactions.read",
                      "invoices.read"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "minLength": 32,
                    "maxLength": 512,
                    "pattern": "^[A-Za-z0-9_.-]+$",
                    "description": "State parameter for CSRF protection (min 32 chars, alphanumeric + _.-)",
                    "example": "abc123xyz789_secure-random-state-value-with-sufficient-entropy"
                  },
                  "teamId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Team ID to authorize the application for",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  }
                },
                "required": [
                  "client_id",
                  "decision",
                  "redirect_uri",
                  "scopes",
                  "state",
                  "teamId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorization decision processed, returns redirect URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "redirect_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "redirect_url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "redirect_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "redirect_url"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "redirect_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "redirect_url"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "summary": "OAuth Token Exchange",
        "operationId": "postOAuthToken",
        "description": "Exchange an authorization code for an access token (authorization_code grant), refresh an existing token (refresh_token grant), or issue a machine-to-machine token (client_credentials grant with private_key_jwt). Accepts both JSON and form-urlencoded bodies. Public clients must not send a client_secret. M2M tokens expire in 15 minutes and do not include refresh tokens.",
        "tags": [
          "OAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "client_id": {
                        "type": "string",
                        "description": "Client ID of the OAuth application",
                        "example": "mid_client_abcdef123456789"
                      },
                      "client_secret": {
                        "type": "string",
                        "description": "Client secret of the OAuth application (required for confidential clients)",
                        "example": "mid_secret_abcdef123456789"
                      },
                      "code": {
                        "type": "string",
                        "description": "Authorization code received from authorization endpoint",
                        "example": "mid_authorization_code_abcdef123456789"
                      },
                      "code_verifier": {
                        "type": "string",
                        "description": "Code verifier for PKCE (required for public clients using PKCE)",
                        "example": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
                      },
                      "grant_type": {
                        "type": "string",
                        "enum": [
                          "authorization_code"
                        ],
                        "description": "OAuth grant type, must be 'authorization_code'",
                        "example": "authorization_code"
                      },
                      "redirect_uri": {
                        "type": "string",
                        "format": "uri",
                        "description": "Redirect URI used in authorization request",
                        "example": "https://myapp.com/callback"
                      }
                    },
                    "required": [
                      "client_id",
                      "code",
                      "grant_type",
                      "redirect_uri"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "client_id": {
                        "type": "string",
                        "description": "Client ID of the OAuth application",
                        "example": "mid_client_abcdef123456789"
                      },
                      "client_secret": {
                        "type": "string",
                        "description": "Client secret of the OAuth application (required for confidential clients)",
                        "example": "mid_secret_abcdef123456789"
                      },
                      "grant_type": {
                        "type": "string",
                        "enum": [
                          "refresh_token"
                        ],
                        "description": "OAuth grant type, must be 'refresh_token'",
                        "example": "refresh_token"
                      },
                      "refresh_token": {
                        "type": "string",
                        "description": "Refresh token received from token endpoint",
                        "example": "mid_rt_abcdef123456789"
                      },
                      "scope": {
                        "type": "string",
                        "description": "Space-separated list of requested scopes (optional)",
                        "example": "transactions.read invoices.read"
                      }
                    },
                    "required": [
                      "client_id",
                      "grant_type",
                      "refresh_token"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "client_assertion": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Signed JWT assertion used to authenticate the OAuth client",
                        "example": "eyJhbGciOiJFUzI1NiIsImtpZCI6Im15LWtleSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtaWRfY2xpZW50X2FiYyIsInN1YiI6Im1pZF9jbGllbnRfYWJjIiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdC9vYXV0aC90b2tlbiIsImV4cCI6MTkxNjIzOTAyMiwiaWF0IjoxOTE2MjM4NzIyLCJqdGkiOiJhc3NlcnRpb24tMTIzIiwidGVhbV9pZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMCIsInNlcnZpY2VfcHJpbmNpcGFsX2lkIjoiMzIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDAwIn0.signature"
                      },
                      "client_assertion_type": {
                        "type": "string",
                        "enum": [
                          "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
                        ],
                        "description": "Client assertion type for private_key_jwt authentication",
                        "example": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
                      },
                      "client_id": {
                        "type": "string",
                        "description": "Client ID of the OAuth application",
                        "example": "mid_client_abcdef123456789"
                      },
                      "grant_type": {
                        "type": "string",
                        "enum": [
                          "client_credentials"
                        ],
                        "description": "OAuth grant type, must be 'client_credentials'",
                        "example": "client_credentials"
                      },
                      "scope": {
                        "type": "string",
                        "description": "Space-separated list of requested scopes (optional)",
                        "example": "transactions.read invoices.read"
                      }
                    },
                    "required": [
                      "client_assertion",
                      "client_assertion_type",
                      "client_id",
                      "grant_type"
                    ]
                  }
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "client_id": {
                        "type": "string",
                        "description": "Client ID of the OAuth application",
                        "example": "mid_client_abcdef123456789"
                      },
                      "client_secret": {
                        "type": "string",
                        "description": "Client secret of the OAuth application (required for confidential clients)",
                        "example": "mid_secret_abcdef123456789"
                      },
                      "code": {
                        "type": "string",
                        "description": "Authorization code received from authorization endpoint",
                        "example": "mid_authorization_code_abcdef123456789"
                      },
                      "code_verifier": {
                        "type": "string",
                        "description": "Code verifier for PKCE (required for public clients using PKCE)",
                        "example": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
                      },
                      "grant_type": {
                        "type": "string",
                        "enum": [
                          "authorization_code"
                        ],
                        "description": "OAuth grant type, must be 'authorization_code'",
                        "example": "authorization_code"
                      },
                      "redirect_uri": {
                        "type": "string",
                        "format": "uri",
                        "description": "Redirect URI used in authorization request",
                        "example": "https://myapp.com/callback"
                      }
                    },
                    "required": [
                      "client_id",
                      "code",
                      "grant_type",
                      "redirect_uri"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "client_id": {
                        "type": "string",
                        "description": "Client ID of the OAuth application",
                        "example": "mid_client_abcdef123456789"
                      },
                      "client_secret": {
                        "type": "string",
                        "description": "Client secret of the OAuth application (required for confidential clients)",
                        "example": "mid_secret_abcdef123456789"
                      },
                      "grant_type": {
                        "type": "string",
                        "enum": [
                          "refresh_token"
                        ],
                        "description": "OAuth grant type, must be 'refresh_token'",
                        "example": "refresh_token"
                      },
                      "refresh_token": {
                        "type": "string",
                        "description": "Refresh token received from token endpoint",
                        "example": "mid_rt_abcdef123456789"
                      },
                      "scope": {
                        "type": "string",
                        "description": "Space-separated list of requested scopes (optional)",
                        "example": "transactions.read invoices.read"
                      }
                    },
                    "required": [
                      "client_id",
                      "grant_type",
                      "refresh_token"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "client_assertion": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Signed JWT assertion used to authenticate the OAuth client",
                        "example": "eyJhbGciOiJFUzI1NiIsImtpZCI6Im15LWtleSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtaWRfY2xpZW50X2FiYyIsInN1YiI6Im1pZF9jbGllbnRfYWJjIiwiYXVkIjoiaHR0cDovL2xvY2FsaG9zdC9vYXV0aC90b2tlbiIsImV4cCI6MTkxNjIzOTAyMiwiaWF0IjoxOTE2MjM4NzIyLCJqdGkiOiJhc3NlcnRpb24tMTIzIiwidGVhbV9pZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMCIsInNlcnZpY2VfcHJpbmNpcGFsX2lkIjoiMzIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDAwIn0.signature"
                      },
                      "client_assertion_type": {
                        "type": "string",
                        "enum": [
                          "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
                        ],
                        "description": "Client assertion type for private_key_jwt authentication",
                        "example": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
                      },
                      "client_id": {
                        "type": "string",
                        "description": "Client ID of the OAuth application",
                        "example": "mid_client_abcdef123456789"
                      },
                      "grant_type": {
                        "type": "string",
                        "enum": [
                          "client_credentials"
                        ],
                        "description": "OAuth grant type, must be 'client_credentials'",
                        "example": "client_credentials"
                      },
                      "scope": {
                        "type": "string",
                        "description": "Space-separated list of requested scopes (optional)",
                        "example": "transactions.read invoices.read"
                      }
                    },
                    "required": [
                      "client_assertion",
                      "client_assertion_type",
                      "client_id",
                      "grant_type"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token exchange successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "description": "Access token for API requests",
                      "example": "mid_access_token_abcdef123456789"
                    },
                    "expires_in": {
                      "type": "number",
                      "description": "Token expiration time in seconds",
                      "example": 3600
                    },
                    "refresh_token": {
                      "type": "string",
                      "description": "Refresh token for obtaining new access tokens (omitted for client_credentials)",
                      "example": "mid_refresh_token_abcdef123456789"
                    },
                    "scope": {
                      "type": "string",
                      "description": "Space-separated list of granted scopes",
                      "example": "transactions.read invoices.read"
                    },
                    "token_type": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ],
                      "description": "Token type, always 'Bearer'",
                      "example": "Bearer"
                    }
                  },
                  "required": [
                    "access_token",
                    "expires_in",
                    "scope",
                    "token_type"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Error code",
                      "example": "invalid_request"
                    },
                    "error_description": {
                      "type": "string",
                      "description": "Human-readable error description",
                      "example": "The request is missing a required parameter"
                    },
                    "error_uri": {
                      "type": "string",
                      "format": "uri",
                      "description": "URI to a human-readable error page",
                      "example": "https://docs.eigenn.io/errors/invalid_request"
                    },
                    "state": {
                      "type": "string",
                      "minLength": 32,
                      "maxLength": 512,
                      "pattern": "^[A-Za-z0-9_.-]+$",
                      "description": "State parameter from the original request (min 32 chars, alphanumeric + _.-)",
                      "example": "abc123xyz789_secure-random-state-value-with-sufficient-entropy"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "summary": "OAuth Token Revocation",
        "operationId": "postOAuthRevoke",
        "description": "Revoke an access token or refresh token. Accepts both JSON and form-urlencoded bodies. Validates client credentials before revoking. Public clients must not send a client_secret. Returns success even if the token was already revoked or invalid (per RFC 7009).",
        "tags": [
          "OAuth"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "Client ID of the OAuth application",
                    "example": "mid_client_abcdef123456789"
                  },
                  "client_secret": {
                    "type": "string",
                    "description": "Client secret of the OAuth application (required for confidential clients)",
                    "example": "mid_secret_abcdef123456789"
                  },
                  "token": {
                    "type": "string",
                    "description": "Token to revoke (access token or refresh token)",
                    "example": "mid_access_token_abcdef123456789"
                  },
                  "token_type_hint": {
                    "type": "string",
                    "enum": [
                      "access_token",
                      "refresh_token"
                    ],
                    "description": "Hint about the token type",
                    "example": "access_token"
                  }
                },
                "required": [
                  "client_id",
                  "token"
                ]
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "Client ID of the OAuth application",
                    "example": "mid_client_abcdef123456789"
                  },
                  "client_secret": {
                    "type": "string",
                    "description": "Client secret of the OAuth application (required for confidential clients)",
                    "example": "mid_secret_abcdef123456789"
                  },
                  "token": {
                    "type": "string",
                    "description": "Token to revoke (access token or refresh token)",
                    "example": "mid_access_token_abcdef123456789"
                  },
                  "token_type_hint": {
                    "type": "string",
                    "enum": [
                      "access_token",
                      "refresh_token"
                    ],
                    "description": "Hint about the token type",
                    "example": "access_token"
                  }
                },
                "required": [
                  "client_id",
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token revocation successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/webhook/inbox": {
      "post": {
        "summary": "Inbox webhook",
        "operationId": "inboxWebhook",
        "description": "Receives inbound email webhook payloads from Postmark and routes them to the correct team inbox. Protected by HTTP Basic Auth and IP allowlist against known Postmark IP ranges. Extracts the inbox ID from OriginalRecipient, resolves the owning team, filters attachments by allowed MIME types and size, uploads them to storage, and triggers background processing jobs. No user-level auth scope required — Postmark authenticates via Basic Auth credentials.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Invalid IP address"
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhook/polar": {
      "post": {
        "summary": "Polar webhook handler",
        "operationId": "polarWebhook",
        "description": "Handles incoming Polar webhook events for subscription lifecycle changes. Verifies the webhook signature using webhook-id/timestamp/signature headers against POLAR_WEBHOOK_SECRET. Supported events: subscription.active (activates plan), subscription.canceled (records cancellation), subscription.past_due (marks as past_due), subscription.revoked (downgrades to trial). No auth scope required — webhook signature verification serves as authorization.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "received"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook signature or payload"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Failed to process webhook event (will trigger retry)"
          }
        }
      }
    },
    "/webhook/whatsapp": {
      "get": {
        "summary": "Verify WhatsApp webhook",
        "operationId": "verifyWhatsAppWebhook",
        "description": "Verifies the WhatsApp webhook URL by checking the verify token and returning the challenge.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "hub.mode",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "hub.verify_token",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "hub.challenge",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook verified successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Verification failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Handle WhatsApp webhook events",
        "operationId": "handleWhatsAppWebhook",
        "description": "Receives and processes incoming WhatsApp messages, media, and interactive responses.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string"
                  },
                  "entry": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "object",
                                "properties": {
                                  "messaging_product": {
                                    "type": "string"
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "properties": {
                                      "display_phone_number": {
                                        "type": "string"
                                      },
                                      "phone_number_id": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "contacts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "profile": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name"
                                          ]
                                        },
                                        "wa_id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "wa_id"
                                      ]
                                    }
                                  },
                                  "messages": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "from": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        },
                                        "timestamp": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "text": {
                                          "type": "object",
                                          "properties": {
                                            "body": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "body"
                                          ]
                                        },
                                        "image": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "mime_type": {
                                              "type": "string"
                                            },
                                            "sha256": {
                                              "type": "string"
                                            },
                                            "caption": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "mime_type"
                                          ]
                                        },
                                        "document": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "mime_type": {
                                              "type": "string"
                                            },
                                            "sha256": {
                                              "type": "string"
                                            },
                                            "filename": {
                                              "type": "string"
                                            },
                                            "caption": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "mime_type"
                                          ]
                                        },
                                        "interactive": {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string"
                                            },
                                            "button_reply": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "title": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "title"
                                              ]
                                            },
                                            "list_reply": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "description": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "title"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ]
                                        },
                                        "context": {
                                          "type": "object",
                                          "properties": {
                                            "from": {
                                              "type": "string"
                                            },
                                            "id": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "required": [
                                        "from",
                                        "id",
                                        "timestamp",
                                        "type"
                                      ]
                                    }
                                  },
                                  "statuses": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "status": {
                                          "type": "string"
                                        },
                                        "timestamp": {
                                          "type": "string"
                                        },
                                        "recipient_id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "status",
                                        "timestamp",
                                        "recipient_id"
                                      ]
                                    }
                                  }
                                }
                              },
                              "field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "value",
                              "field"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "changes"
                      ]
                    }
                  }
                },
                "required": [
                  "object",
                  "entry"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Invalid signature",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhook/stripe": {
      "post": {
        "summary": "Stripe webhook handler",
        "operationId": "stripeWebhook",
        "description": "Handles incoming Stripe Connect webhook events for the invoice payment lifecycle. Verifies the webhook signature using STRIPE_CONNECT_WEBHOOK_SECRET before processing. Supported events: payment_intent.succeeded (marks invoice paid), payment_intent.payment_failed (logs failure), charge.refunded (reverts invoice to unpaid), account.updated (syncs Connect status). Events are persisted to webhook_events with idempotency on stripe_event_id. No auth scope required — signature verification serves as authorization.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "received"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook signature or payload"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/webhook/e-invoicing/storecove": {
      "post": {
        "summary": "Storecove Webhook",
        "operationId": "handleStorecoveWebhook",
        "description": "Handles e-invoice delivery status updates from Storecove",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "document.submitted",
                      "document.sent",
                      "document.delivered",
                      "document.rejected",
                      "document.error"
                    ]
                  },
                  "guid": {
                    "type": "string"
                  },
                  "legal_entity_id": {
                    "type": "number"
                  },
                  "timestamp": {
                    "type": "string"
                  },
                  "document_id": {
                    "type": "string"
                  },
                  "error": {
                    "type": "string"
                  },
                  "rejection_reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "event",
                  "guid",
                  "legal_entity_id",
                  "timestamp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook payload"
          },
          "401": {
            "description": "Invalid webhook signature"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/files/proxy": {
      "get": {
        "summary": "Proxy file from storage",
        "operationId": "proxyFile",
        "x-speakeasy-name-override": "proxy",
        "description": "Proxies a file from storage. Requires authenticated access to the matching workspace.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Path to the file in storage. Can include or exclude 'vault/' prefix.",
              "example": "vault/documents/2024/invoice.pdf"
            },
            "required": true,
            "description": "Path to the file in storage. Can include or exclude 'vault/' prefix.",
            "in": "query",
            "name": "filePath"
          }
        ],
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/download/file": {
      "get": {
        "summary": "Download file from vault",
        "operationId": "downloadFile",
        "x-speakeasy-name-override": "downloadFile",
        "description": "Downloads a file from the vault storage bucket. Requires authenticated access to the matching workspace.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Path to the file in storage. Can include or exclude 'vault/' prefix.",
              "example": "vault/documents/2024/invoice.pdf"
            },
            "required": true,
            "description": "Path to the file in storage. Can include or exclude 'vault/' prefix.",
            "in": "query",
            "name": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Optional filename for the Content-Disposition header.",
              "example": "invoice.pdf"
            },
            "required": false,
            "description": "Optional filename for the Content-Disposition header.",
            "in": "query",
            "name": "filename"
          }
        ],
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/download/invoice": {
      "get": {
        "summary": "Download invoice PDF",
        "operationId": "downloadInvoice",
        "x-speakeasy-name-override": "downloadInvoice",
        "description": "Downloads an invoice as a PDF. Invoice IDs require authenticated workspace access. Invoice tokens remain publicly accessible.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Invoice ID (UUID). Requires authenticated workspace access.",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": false,
            "description": "Invoice ID (UUID). Requires authenticated workspace access.",
            "in": "query",
            "name": "id"
          },
          {
            "schema": {
              "type": "string",
              "description": "Invoice access token for public access. When used alone (without id), allows public access to the invoice.",
              "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
            },
            "required": false,
            "description": "Invoice access token for public access. When used alone (without id), allows public access to the invoice.",
            "in": "query",
            "name": "token"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "default": false,
              "description": "If true, the PDF will be displayed inline. If false, it will be downloaded.",
              "example": false
            },
            "required": false,
            "description": "If true, the PDF will be displayed inline. If false, it will be downloaded.",
            "in": "query",
            "name": "preview"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "invoice",
                "receipt"
              ],
              "default": "invoice",
              "description": "Type of document to download. Use 'receipt' to download a receipt for paid invoices.",
              "example": "invoice"
            },
            "required": false,
            "description": "Type of document to download. Use 'receipt' to download a receipt for paid invoices.",
            "in": "query",
            "name": "type"
          }
        ],
        "responses": {
          "200": {
            "description": "Invoice PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/slack/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Slack after user authorization. Exchanges authorization code for access token and creates app integration.",
        "operationId": "slackOAuthCallback",
        "summary": "Slack OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code from Slack"
            },
            "required": true,
            "description": "OAuth authorization code from Slack",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard completion page",
            "headers": {
              "Location": {
                "description": "Redirect URL to dashboard",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to process OAuth callback",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/slack/install-url": {
      "get": {
        "summary": "Get Slack install URL",
        "operationId": "getSlackInstallUrl",
        "description": "Generates OAuth install URL for Slack integration. Requires authentication.",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Slack install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/apps/slack/webhook": {
      "post": {
        "summary": "Slack webhook handler",
        "operationId": "slackWebhook",
        "description": "Handles incoming webhook events from Slack. Verifies request signature and processes events.",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "challenge": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/apps/slack/interactions": {
      "post": {
        "description": "Handles interactive component actions from Slack (button clicks, etc.)",
        "operationId": "slackInteractions",
        "summary": "Slack interactions handler",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Interaction handled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/apps/gmail/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Google after user authorization. Exchanges authorization code for access token and creates inbox account.",
        "operationId": "gmailOAuthCallback",
        "summary": "Gmail OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code from Google"
            },
            "required": false,
            "description": "OAuth authorization code from Google",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "Encrypted OAuth state parameter"
            },
            "required": true,
            "description": "Encrypted OAuth state parameter",
            "in": "query",
            "name": "state"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "description": "Redirect URL to dashboard",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to process OAuth callback",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/gmail/install-url": {
      "get": {
        "summary": "Get Gmail install URL",
        "operationId": "getGmailInstallUrl",
        "description": "Generates OAuth install URL for Gmail integration. Requires authentication.\n\nRequired scopes: inbox.write",
        "tags": [
          "Integrations"
        ],
        "x-oppulence-required-scopes": [
          "inbox.write"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.write"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Gmail install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/apps/outlook/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Microsoft after user authorization. Exchanges authorization code for access token and creates inbox account.",
        "operationId": "outlookOAuthCallback",
        "summary": "Outlook OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code from Microsoft"
            },
            "required": false,
            "description": "OAuth authorization code from Microsoft",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "Encrypted OAuth state parameter"
            },
            "required": true,
            "description": "Encrypted OAuth state parameter",
            "in": "query",
            "name": "state"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "description": "Redirect URL to dashboard",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Failed to process OAuth callback",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/outlook/install-url": {
      "get": {
        "summary": "Get Outlook install URL",
        "operationId": "getOutlookInstallUrl",
        "description": "Generates OAuth install URL for Outlook integration. Requires authentication.\n\nRequired scopes: inbox.write",
        "tags": [
          "Integrations"
        ],
        "x-oppulence-required-scopes": [
          "inbox.write"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.write"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Outlook install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/install-url": {
      "get": {
        "description": "Generates OAuth install URL for QuickBooks integration.",
        "operationId": "getQuickbooksInstallUrl",
        "summary": "Get QuickBooks install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "QuickBooks install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/quickbooks/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from QuickBooks.",
        "operationId": "quickbooksOAuthCallback",
        "summary": "QuickBooks OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/status": {
      "get": {
        "description": "Check if QuickBooks is connected and tokens are valid.",
        "operationId": "getQuickbooksStatus",
        "summary": "Get QuickBooks connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "QuickBooks connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for QuickBooks.",
        "operationId": "refreshQuickbooksTokens",
        "summary": "Refresh QuickBooks tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/disconnect": {
      "delete": {
        "description": "Remove QuickBooks integration.",
        "operationId": "disconnectQuickbooks",
        "summary": "Disconnect QuickBooks",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Xero integration.",
        "operationId": "getXeroInstallUrl",
        "summary": "Get Xero install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Xero install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/xero/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Xero.",
        "operationId": "xeroOAuthCallback",
        "summary": "Xero OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/status": {
      "get": {
        "description": "Check if Xero is connected and tokens are valid.",
        "operationId": "getXeroStatus",
        "summary": "Get Xero connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Xero connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Xero.",
        "operationId": "refreshXeroTokens",
        "summary": "Refresh Xero tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/disconnect": {
      "delete": {
        "description": "Remove Xero integration.",
        "operationId": "disconnectXero",
        "summary": "Disconnect Xero",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Fortnox integration.",
        "operationId": "getFortnoxInstallUrl",
        "summary": "Get Fortnox install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Fortnox install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/fortnox/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Fortnox.",
        "operationId": "fortnoxOAuthCallback",
        "summary": "Fortnox OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/status": {
      "get": {
        "description": "Check if Fortnox is connected and tokens are valid.",
        "operationId": "getFortnoxStatus",
        "summary": "Get Fortnox connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Fortnox connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Fortnox.",
        "operationId": "refreshFortnoxTokens",
        "summary": "Refresh Fortnox tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/disconnect": {
      "delete": {
        "description": "Remove Fortnox integration.",
        "operationId": "disconnectFortnox",
        "summary": "Disconnect Fortnox",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/install-url": {
      "get": {
        "description": "Generates OAuth install URL for FreshBooks integration.",
        "operationId": "getFreshbooksInstallUrl",
        "summary": "Get FreshBooks install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "FreshBooks install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/freshbooks/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from FreshBooks.",
        "operationId": "freshbooksOAuthCallback",
        "summary": "FreshBooks OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/status": {
      "get": {
        "description": "Check if FreshBooks is connected and tokens are valid.",
        "operationId": "getFreshbooksStatus",
        "summary": "Get FreshBooks connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "FreshBooks connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for FreshBooks.",
        "operationId": "refreshFreshbooksTokens",
        "summary": "Refresh FreshBooks tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/disconnect": {
      "delete": {
        "description": "Remove FreshBooks integration.",
        "operationId": "disconnectFreshbooks",
        "summary": "Disconnect FreshBooks",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Wave integration.",
        "operationId": "getWaveInstallUrl",
        "summary": "Get Wave install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Wave install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/wave/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Wave.",
        "operationId": "waveOAuthCallback",
        "summary": "Wave OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/status": {
      "get": {
        "description": "Check if Wave is connected and tokens are valid.",
        "operationId": "getWaveStatus",
        "summary": "Get Wave connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Wave connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Wave.",
        "operationId": "refreshWaveTokens",
        "summary": "Refresh Wave tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/disconnect": {
      "delete": {
        "description": "Remove Wave integration.",
        "operationId": "disconnectWave",
        "summary": "Disconnect Wave",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Bench integration.",
        "operationId": "getBenchInstallUrl",
        "summary": "Get Bench install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Bench install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/bench/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Bench.",
        "operationId": "benchOAuthCallback",
        "summary": "Bench OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/status": {
      "get": {
        "description": "Check if Bench is connected and tokens are valid.",
        "operationId": "getBenchStatus",
        "summary": "Get Bench connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Bench connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Bench.",
        "operationId": "refreshBenchTokens",
        "summary": "Refresh Bench tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/disconnect": {
      "delete": {
        "description": "Remove Bench integration.",
        "operationId": "disconnectBench",
        "summary": "Disconnect Bench",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Zoho Books integration.",
        "operationId": "getZohoInstallUrl",
        "summary": "Get Zoho Books install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Zoho Books install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/zoho/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Zoho Books.",
        "operationId": "zohoOAuthCallback",
        "summary": "Zoho Books OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/status": {
      "get": {
        "description": "Check if Zoho Books is connected and tokens are valid.",
        "operationId": "getZohoStatus",
        "summary": "Get Zoho Books connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Zoho Books connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Zoho Books.",
        "operationId": "refreshZohoTokens",
        "summary": "Refresh Zoho Books tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/disconnect": {
      "delete": {
        "description": "Remove Zoho Books integration.",
        "operationId": "disconnectZoho",
        "summary": "Disconnect Zoho Books",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Clear Books integration.",
        "operationId": "getClearbooksInstallUrl",
        "summary": "Get Clear Books install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Clear Books install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/clearbooks/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Clear Books.",
        "operationId": "clearbooksOAuthCallback",
        "summary": "Clear Books OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/status": {
      "get": {
        "description": "Check if Clear Books is connected and tokens are valid.",
        "operationId": "getClearbooksStatus",
        "summary": "Get Clear Books connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Clear Books connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Clear Books.",
        "operationId": "refreshClearbooksTokens",
        "summary": "Refresh Clear Books tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/disconnect": {
      "delete": {
        "description": "Remove Clear Books integration.",
        "operationId": "disconnectClearbooks",
        "summary": "Disconnect Clear Books",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/install-url": {
      "get": {
        "description": "Generates OAuth install URL for FreeAgent integration.",
        "operationId": "getFreeagentInstallUrl",
        "summary": "Get FreeAgent install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "FreeAgent install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/freeagent/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from FreeAgent.",
        "operationId": "freeagentOAuthCallback",
        "summary": "FreeAgent OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/status": {
      "get": {
        "description": "Check if FreeAgent is connected and tokens are valid.",
        "operationId": "getFreeagentStatus",
        "summary": "Get FreeAgent connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "FreeAgent connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for FreeAgent.",
        "operationId": "refreshFreeagentTokens",
        "summary": "Refresh FreeAgent tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/disconnect": {
      "delete": {
        "description": "Remove FreeAgent integration.",
        "operationId": "disconnectFreeagent",
        "summary": "Disconnect FreeAgent",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Moneybird integration.",
        "operationId": "getMoneybirdInstallUrl",
        "summary": "Get Moneybird install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Moneybird install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/moneybird/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Moneybird.",
        "operationId": "moneybirdOAuthCallback",
        "summary": "Moneybird OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/status": {
      "get": {
        "description": "Check if Moneybird is connected and tokens are valid.",
        "operationId": "getMoneybirdStatus",
        "summary": "Get Moneybird connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Moneybird connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Moneybird.",
        "operationId": "refreshMoneybirdTokens",
        "summary": "Refresh Moneybird tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/disconnect": {
      "delete": {
        "description": "Remove Moneybird integration.",
        "operationId": "disconnectMoneybird",
        "summary": "Disconnect Moneybird",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/install-url": {
      "get": {
        "description": "Generates OAuth install URL for NetSuite integration.",
        "operationId": "getNetsuiteInstallUrl",
        "summary": "Get NetSuite install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "NetSuite install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/netsuite/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from NetSuite.",
        "operationId": "netsuiteOAuthCallback",
        "summary": "NetSuite OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/status": {
      "get": {
        "description": "Check if NetSuite is connected and tokens are valid.",
        "operationId": "getNetsuiteStatus",
        "summary": "Get NetSuite connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "NetSuite connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for NetSuite.",
        "operationId": "refreshNetsuiteTokens",
        "summary": "Refresh NetSuite tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/disconnect": {
      "delete": {
        "description": "Remove NetSuite integration.",
        "operationId": "disconnectNetsuite",
        "summary": "Disconnect NetSuite",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Sage Business Cloud Accounting integration.",
        "operationId": "getSage-accountingInstallUrl",
        "summary": "Get Sage Business Cloud Accounting install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Sage Business Cloud Accounting install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/sage-accounting/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Sage Business Cloud Accounting.",
        "operationId": "sage-accountingOAuthCallback",
        "summary": "Sage Business Cloud Accounting OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/status": {
      "get": {
        "description": "Check if Sage Business Cloud Accounting is connected and tokens are valid.",
        "operationId": "getSage-accountingStatus",
        "summary": "Get Sage Business Cloud Accounting connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Sage Business Cloud Accounting connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Sage Business Cloud Accounting.",
        "operationId": "refreshSage-accountingTokens",
        "summary": "Refresh Sage Business Cloud Accounting tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/disconnect": {
      "delete": {
        "description": "Remove Sage Business Cloud Accounting integration.",
        "operationId": "disconnectSage-accounting",
        "summary": "Disconnect Sage Business Cloud Accounting",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Sage Intacct integration.",
        "operationId": "getSage-intacctInstallUrl",
        "summary": "Get Sage Intacct install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Sage Intacct install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/sage-intacct/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Sage Intacct.",
        "operationId": "sage-intacctOAuthCallback",
        "summary": "Sage Intacct OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/status": {
      "get": {
        "description": "Check if Sage Intacct is connected and tokens are valid.",
        "operationId": "getSage-intacctStatus",
        "summary": "Get Sage Intacct connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Sage Intacct connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Sage Intacct.",
        "operationId": "refreshSage-intacctTokens",
        "summary": "Refresh Sage Intacct tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/disconnect": {
      "delete": {
        "description": "Remove Sage Intacct integration.",
        "operationId": "disconnectSage-intacct",
        "summary": "Disconnect Sage Intacct",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/install-url": {
      "get": {
        "description": "Generates OAuth install URL for Microsoft Dynamics 365 Business Central integration.",
        "operationId": "getDynamics365InstallUrl",
        "summary": "Get Microsoft Dynamics 365 Business Central install URL",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Microsoft Dynamics 365 Business Central install URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/apps/dynamics365/oauth-callback": {
      "get": {
        "description": "Handles OAuth callback from Microsoft Dynamics 365 Business Central.",
        "operationId": "dynamics365OAuthCallback",
        "summary": "Microsoft Dynamics 365 Business Central OAuth callback",
        "tags": [
          "Integrations"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code"
            },
            "required": false,
            "description": "OAuth authorization code",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "QuickBooks company/realm ID"
            },
            "required": false,
            "description": "QuickBooks company/realm ID",
            "in": "query",
            "name": "realmId"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho accounts server URL"
            },
            "required": false,
            "description": "Zoho accounts server URL",
            "in": "query",
            "name": "accounts-server"
          },
          {
            "schema": {
              "type": "string",
              "description": "Zoho data center location"
            },
            "required": false,
            "description": "Zoho data center location",
            "in": "query",
            "name": "location"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/status": {
      "get": {
        "description": "Check if Microsoft Dynamics 365 Business Central is connected and tokens are valid.",
        "operationId": "getDynamics365Status",
        "summary": "Get Microsoft Dynamics 365 Business Central connection status",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Microsoft Dynamics 365 Business Central connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "isExpired": {
                      "type": "boolean"
                    },
                    "needsReauth": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "connected",
                    "provider"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/refresh": {
      "post": {
        "description": "Refresh OAuth tokens for Microsoft Dynamics 365 Business Central.",
        "operationId": "refreshDynamics365Tokens",
        "summary": "Refresh Microsoft Dynamics 365 Business Central tokens",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Tokens refreshed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No refresh token"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/disconnect": {
      "delete": {
        "description": "Remove Microsoft Dynamics 365 Business Central integration.",
        "operationId": "disconnectDynamics365",
        "summary": "Disconnect Microsoft Dynamics 365 Business Central",
        "tags": [
          "Integrations"
        ],
        "responses": {
          "200": {
            "description": "Disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/operations/accounts": {
      "get": {
        "summary": "Get QuickBooks accounts",
        "operationId": "getQuickbooksAccounts",
        "description": "Fetch available bank/cash accounts from QuickBooks.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/operations/tenants": {
      "get": {
        "summary": "Get QuickBooks tenants",
        "operationId": "getQuickbooksTenants",
        "description": "Fetch available tenants/organizations from QuickBooks.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/operations/tenant-info": {
      "get": {
        "summary": "Get QuickBooks tenant info",
        "operationId": "getQuickbooksTenantInfo",
        "description": "Fetch information about the connected QuickBooks organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/operations/check": {
      "get": {
        "summary": "Check QuickBooks connection",
        "operationId": "checkQuickbooksConnection",
        "description": "Verify the QuickBooks connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/quickbooks/operations/sync": {
      "post": {
        "summary": "Sync transactions to QuickBooks",
        "operationId": "syncQuickbooksTransactions",
        "description": "Sync transactions to QuickBooks accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/operations/accounts": {
      "get": {
        "summary": "Get Xero accounts",
        "operationId": "getXeroAccounts",
        "description": "Fetch available bank/cash accounts from Xero.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/operations/tenants": {
      "get": {
        "summary": "Get Xero tenants",
        "operationId": "getXeroTenants",
        "description": "Fetch available tenants/organizations from Xero.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/operations/tenant-info": {
      "get": {
        "summary": "Get Xero tenant info",
        "operationId": "getXeroTenantInfo",
        "description": "Fetch information about the connected Xero organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/operations/check": {
      "get": {
        "summary": "Check Xero connection",
        "operationId": "checkXeroConnection",
        "description": "Verify the Xero connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/xero/operations/sync": {
      "post": {
        "summary": "Sync transactions to Xero",
        "operationId": "syncXeroTransactions",
        "description": "Sync transactions to Xero accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/operations/accounts": {
      "get": {
        "summary": "Get Fortnox accounts",
        "operationId": "getFortnoxAccounts",
        "description": "Fetch available bank/cash accounts from Fortnox.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/operations/tenants": {
      "get": {
        "summary": "Get Fortnox tenants",
        "operationId": "getFortnoxTenants",
        "description": "Fetch available tenants/organizations from Fortnox.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/operations/tenant-info": {
      "get": {
        "summary": "Get Fortnox tenant info",
        "operationId": "getFortnoxTenantInfo",
        "description": "Fetch information about the connected Fortnox organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/operations/check": {
      "get": {
        "summary": "Check Fortnox connection",
        "operationId": "checkFortnoxConnection",
        "description": "Verify the Fortnox connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/fortnox/operations/sync": {
      "post": {
        "summary": "Sync transactions to Fortnox",
        "operationId": "syncFortnoxTransactions",
        "description": "Sync transactions to Fortnox accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/operations/accounts": {
      "get": {
        "summary": "Get FreshBooks accounts",
        "operationId": "getFreshbooksAccounts",
        "description": "Fetch available bank/cash accounts from FreshBooks.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/operations/tenants": {
      "get": {
        "summary": "Get FreshBooks tenants",
        "operationId": "getFreshbooksTenants",
        "description": "Fetch available tenants/organizations from FreshBooks.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/operations/tenant-info": {
      "get": {
        "summary": "Get FreshBooks tenant info",
        "operationId": "getFreshbooksTenantInfo",
        "description": "Fetch information about the connected FreshBooks organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/operations/check": {
      "get": {
        "summary": "Check FreshBooks connection",
        "operationId": "checkFreshbooksConnection",
        "description": "Verify the FreshBooks connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freshbooks/operations/sync": {
      "post": {
        "summary": "Sync transactions to FreshBooks",
        "operationId": "syncFreshbooksTransactions",
        "description": "Sync transactions to FreshBooks accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/operations/accounts": {
      "get": {
        "summary": "Get Wave accounts",
        "operationId": "getWaveAccounts",
        "description": "Fetch available bank/cash accounts from Wave.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/operations/tenants": {
      "get": {
        "summary": "Get Wave tenants",
        "operationId": "getWaveTenants",
        "description": "Fetch available tenants/organizations from Wave.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/operations/tenant-info": {
      "get": {
        "summary": "Get Wave tenant info",
        "operationId": "getWaveTenantInfo",
        "description": "Fetch information about the connected Wave organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/operations/check": {
      "get": {
        "summary": "Check Wave connection",
        "operationId": "checkWaveConnection",
        "description": "Verify the Wave connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/wave/operations/sync": {
      "post": {
        "summary": "Sync transactions to Wave",
        "operationId": "syncWaveTransactions",
        "description": "Sync transactions to Wave accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/operations/accounts": {
      "get": {
        "summary": "Get Bench accounts",
        "operationId": "getBenchAccounts",
        "description": "Fetch available bank/cash accounts from Bench.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/operations/tenants": {
      "get": {
        "summary": "Get Bench tenants",
        "operationId": "getBenchTenants",
        "description": "Fetch available tenants/organizations from Bench.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/operations/tenant-info": {
      "get": {
        "summary": "Get Bench tenant info",
        "operationId": "getBenchTenantInfo",
        "description": "Fetch information about the connected Bench organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/operations/check": {
      "get": {
        "summary": "Check Bench connection",
        "operationId": "checkBenchConnection",
        "description": "Verify the Bench connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/bench/operations/sync": {
      "post": {
        "summary": "Sync transactions to Bench",
        "operationId": "syncBenchTransactions",
        "description": "Sync transactions to Bench accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/operations/accounts": {
      "get": {
        "summary": "Get Zoho Books accounts",
        "operationId": "getZohoAccounts",
        "description": "Fetch available bank/cash accounts from Zoho Books.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/operations/tenants": {
      "get": {
        "summary": "Get Zoho Books tenants",
        "operationId": "getZohoTenants",
        "description": "Fetch available tenants/organizations from Zoho Books.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/operations/tenant-info": {
      "get": {
        "summary": "Get Zoho Books tenant info",
        "operationId": "getZohoTenantInfo",
        "description": "Fetch information about the connected Zoho Books organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/operations/check": {
      "get": {
        "summary": "Check Zoho Books connection",
        "operationId": "checkZohoConnection",
        "description": "Verify the Zoho Books connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/zoho/operations/sync": {
      "post": {
        "summary": "Sync transactions to Zoho Books",
        "operationId": "syncZohoTransactions",
        "description": "Sync transactions to Zoho Books accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/operations/accounts": {
      "get": {
        "summary": "Get Clear Books accounts",
        "operationId": "getClearbooksAccounts",
        "description": "Fetch available bank/cash accounts from Clear Books.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/operations/tenants": {
      "get": {
        "summary": "Get Clear Books tenants",
        "operationId": "getClearbooksTenants",
        "description": "Fetch available tenants/organizations from Clear Books.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/operations/tenant-info": {
      "get": {
        "summary": "Get Clear Books tenant info",
        "operationId": "getClearbooksTenantInfo",
        "description": "Fetch information about the connected Clear Books organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/operations/check": {
      "get": {
        "summary": "Check Clear Books connection",
        "operationId": "checkClearbooksConnection",
        "description": "Verify the Clear Books connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/clearbooks/operations/sync": {
      "post": {
        "summary": "Sync transactions to Clear Books",
        "operationId": "syncClearbooksTransactions",
        "description": "Sync transactions to Clear Books accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/operations/accounts": {
      "get": {
        "summary": "Get FreeAgent accounts",
        "operationId": "getFreeagentAccounts",
        "description": "Fetch available bank/cash accounts from FreeAgent.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/operations/tenants": {
      "get": {
        "summary": "Get FreeAgent tenants",
        "operationId": "getFreeagentTenants",
        "description": "Fetch available tenants/organizations from FreeAgent.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/operations/tenant-info": {
      "get": {
        "summary": "Get FreeAgent tenant info",
        "operationId": "getFreeagentTenantInfo",
        "description": "Fetch information about the connected FreeAgent organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/operations/check": {
      "get": {
        "summary": "Check FreeAgent connection",
        "operationId": "checkFreeagentConnection",
        "description": "Verify the FreeAgent connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/freeagent/operations/sync": {
      "post": {
        "summary": "Sync transactions to FreeAgent",
        "operationId": "syncFreeagentTransactions",
        "description": "Sync transactions to FreeAgent accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/operations/accounts": {
      "get": {
        "summary": "Get Moneybird accounts",
        "operationId": "getMoneybirdAccounts",
        "description": "Fetch available bank/cash accounts from Moneybird.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/operations/tenants": {
      "get": {
        "summary": "Get Moneybird tenants",
        "operationId": "getMoneybirdTenants",
        "description": "Fetch available tenants/organizations from Moneybird.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/operations/tenant-info": {
      "get": {
        "summary": "Get Moneybird tenant info",
        "operationId": "getMoneybirdTenantInfo",
        "description": "Fetch information about the connected Moneybird organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/operations/check": {
      "get": {
        "summary": "Check Moneybird connection",
        "operationId": "checkMoneybirdConnection",
        "description": "Verify the Moneybird connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/moneybird/operations/sync": {
      "post": {
        "summary": "Sync transactions to Moneybird",
        "operationId": "syncMoneybirdTransactions",
        "description": "Sync transactions to Moneybird accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/operations/accounts": {
      "get": {
        "summary": "Get NetSuite accounts",
        "operationId": "getNetsuiteAccounts",
        "description": "Fetch available bank/cash accounts from NetSuite.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/operations/tenants": {
      "get": {
        "summary": "Get NetSuite tenants",
        "operationId": "getNetsuiteTenants",
        "description": "Fetch available tenants/organizations from NetSuite.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/operations/tenant-info": {
      "get": {
        "summary": "Get NetSuite tenant info",
        "operationId": "getNetsuiteTenantInfo",
        "description": "Fetch information about the connected NetSuite organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/operations/check": {
      "get": {
        "summary": "Check NetSuite connection",
        "operationId": "checkNetsuiteConnection",
        "description": "Verify the NetSuite connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/netsuite/operations/sync": {
      "post": {
        "summary": "Sync transactions to NetSuite",
        "operationId": "syncNetsuiteTransactions",
        "description": "Sync transactions to NetSuite accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/operations/accounts": {
      "get": {
        "summary": "Get Sage Business Cloud Accounting accounts",
        "operationId": "getSageAccountingAccounts",
        "description": "Fetch available bank/cash accounts from Sage Business Cloud Accounting.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/operations/tenants": {
      "get": {
        "summary": "Get Sage Business Cloud Accounting tenants",
        "operationId": "getSageAccountingTenants",
        "description": "Fetch available tenants/organizations from Sage Business Cloud Accounting.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/operations/tenant-info": {
      "get": {
        "summary": "Get Sage Business Cloud Accounting tenant info",
        "operationId": "getSageAccountingTenantInfo",
        "description": "Fetch information about the connected Sage Business Cloud Accounting organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/operations/check": {
      "get": {
        "summary": "Check Sage Business Cloud Accounting connection",
        "operationId": "checkSageAccountingConnection",
        "description": "Verify the Sage Business Cloud Accounting connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-accounting/operations/sync": {
      "post": {
        "summary": "Sync transactions to Sage Business Cloud Accounting",
        "operationId": "syncSageAccountingTransactions",
        "description": "Sync transactions to Sage Business Cloud Accounting accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/operations/accounts": {
      "get": {
        "summary": "Get Sage Intacct accounts",
        "operationId": "getSageIntacctAccounts",
        "description": "Fetch available bank/cash accounts from Sage Intacct.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/operations/tenants": {
      "get": {
        "summary": "Get Sage Intacct tenants",
        "operationId": "getSageIntacctTenants",
        "description": "Fetch available tenants/organizations from Sage Intacct.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/operations/tenant-info": {
      "get": {
        "summary": "Get Sage Intacct tenant info",
        "operationId": "getSageIntacctTenantInfo",
        "description": "Fetch information about the connected Sage Intacct organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/operations/check": {
      "get": {
        "summary": "Check Sage Intacct connection",
        "operationId": "checkSageIntacctConnection",
        "description": "Verify the Sage Intacct connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/sage-intacct/operations/sync": {
      "post": {
        "summary": "Sync transactions to Sage Intacct",
        "operationId": "syncSageIntacctTransactions",
        "description": "Sync transactions to Sage Intacct accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/operations/accounts": {
      "get": {
        "summary": "Get Microsoft Dynamics 365 Business Central accounts",
        "operationId": "getDynamics365Accounts",
        "description": "Fetch available bank/cash accounts from Microsoft Dynamics 365 Business Central.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "archived"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "type",
                          "status"
                        ]
                      }
                    }
                  },
                  "required": [
                    "accounts"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/operations/tenants": {
      "get": {
        "summary": "Get Microsoft Dynamics 365 Business Central tenants",
        "operationId": "getDynamics365Tenants",
        "description": "Fetch available tenants/organizations from Microsoft Dynamics 365 Business Central.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "List of tenants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tenantId": {
                            "type": "string"
                          },
                          "tenantName": {
                            "type": "string"
                          },
                          "tenantType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tenantId",
                          "tenantName",
                          "tenantType"
                        ]
                      }
                    }
                  },
                  "required": [
                    "tenants"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/operations/tenant-info": {
      "get": {
        "summary": "Get Microsoft Dynamics 365 Business Central tenant info",
        "operationId": "getDynamics365TenantInfo",
        "description": "Fetch information about the connected Microsoft Dynamics 365 Business Central organization.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Tenant information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/operations/check": {
      "get": {
        "summary": "Check Microsoft Dynamics 365 Business Central connection",
        "operationId": "checkDynamics365Connection",
        "description": "Verify the Microsoft Dynamics 365 Business Central connection is healthy.",
        "tags": [
          "Accounting Operations"
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "connected"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/apps/dynamics365/operations/sync": {
      "post": {
        "summary": "Sync transactions to Microsoft Dynamics 365 Business Central",
        "operationId": "syncDynamics365Transactions",
        "description": "Sync transactions to Microsoft Dynamics 365 Business Central accounting software.",
        "tags": [
          "Accounting Operations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "date": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "number"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "counterpartyName": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "categoryReportingCode": {
                          "type": "string"
                        },
                        "bankAccountCode": {
                          "type": "string"
                        },
                        "costCenter": {
                          "type": "string"
                        },
                        "project": {
                          "type": "string"
                        },
                        "taxAmount": {
                          "type": "number"
                        },
                        "taxRate": {
                          "type": "number"
                        },
                        "taxType": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "date",
                        "amount",
                        "currency",
                        "description"
                      ]
                    }
                  },
                  "targetAccountId": {
                    "type": "string"
                  },
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "transactions",
                  "targetAccountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "syncedCount": {
                      "type": "number"
                    },
                    "failedCount": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transactionId": {
                            "type": "string"
                          },
                          "providerTransactionId": {
                            "type": "string"
                          },
                          "providerEntityType": {
                            "type": "string"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "error": {
                            "type": "string"
                          },
                          "errorCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "transactionId",
                          "success"
                        ]
                      }
                    }
                  },
                  "required": [
                    "success",
                    "syncedCount",
                    "failedCount",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/invoice-payments/connect-stripe": {
      "get": {
        "description": "Generates OAuth URL for Stripe Connect Standard integration. Allows teams to connect their Stripe account for accepting invoice payments.\n\nRequired scopes: invoices.write",
        "operationId": "getStripeConnectUrl",
        "summary": "Get Stripe Connect URL",
        "tags": [
          "Invoice Payments"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Stripe Connect OAuth URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error - Stripe configuration missing"
          }
        }
      }
    },
    "/invoice-payments/connect-stripe/callback": {
      "get": {
        "description": "Handles OAuth callback from Stripe Connect after user authorization. Exchanges authorization code for connected account ID.",
        "operationId": "stripeConnectCallback",
        "summary": "Stripe Connect OAuth callback",
        "tags": [
          "Invoice Payments"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "OAuth authorization code from Stripe"
            },
            "required": false,
            "description": "OAuth authorization code from Stripe",
            "in": "query",
            "name": "code"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error code if authorization failed"
            },
            "required": false,
            "description": "OAuth error code if authorization failed",
            "in": "query",
            "name": "error"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth error description"
            },
            "required": false,
            "description": "OAuth error description",
            "in": "query",
            "name": "error_description"
          },
          {
            "schema": {
              "type": "string",
              "description": "OAuth state parameter for CSRF protection"
            },
            "required": true,
            "description": "OAuth state parameter for CSRF protection",
            "in": "query",
            "name": "state"
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to dashboard",
            "headers": {
              "Location": {
                "description": "Redirect URL",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-payments/disconnect-stripe": {
      "post": {
        "description": "Disconnect the team's Stripe Connect account. Deauthorizes the connected account on Stripe's side and clears the stripeAccountId and stripeConnectStatus fields from the team record. If deauthorization fails on Stripe (e.g. account already disconnected), the local fields are still cleared.\n\nRequired scopes: invoices.write",
        "operationId": "disconnectStripe",
        "summary": "Disconnect Stripe account",
        "tags": [
          "Invoice Payments"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully disconnected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-payments/payment-intent": {
      "post": {
        "description": "Creates a Stripe PaymentIntent for paying an invoice. This is a public endpoint that uses the invoice token for authentication.",
        "operationId": "createInvoicePaymentIntent",
        "summary": "Create payment intent for invoice",
        "tags": [
          "Invoice Payments"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Invoice token for authentication"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment intent created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "clientSecret": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "stripeAccountId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "amount",
                    "clientSecret",
                    "currency",
                    "stripeAccountId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or invoice not payable"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-payments/stripe-status": {
      "get": {
        "description": "Get the current Stripe Connect integration status for the authenticated team. Returns whether a Stripe account is connected, its status (connected or restricted), and the Stripe account ID. Use this to determine if the team can accept online invoice payments.\n\nRequired scopes: invoices.read",
        "operationId": "getStripeConnectStatus",
        "summary": "Get Stripe Connect status",
        "tags": [
          "Invoice Payments"
        ],
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Stripe Connect status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "stripeAccountId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "connected",
                    "status",
                    "stripeAccountId"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/inbox": {
      "post": {
        "summary": "Inbox webhook",
        "operationId": "inboxWebhook",
        "description": "Receives inbound email webhook payloads from Postmark and routes them to the correct team inbox. Protected by HTTP Basic Auth and IP allowlist against known Postmark IP ranges. Extracts the inbox ID from OriginalRecipient, resolves the owning team, filters attachments by allowed MIME types and size, uploads them to storage, and triggers background processing jobs. No user-level auth scope required — Postmark authenticates via Basic Auth credentials.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "path",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Invalid IP address"
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/polar": {
      "post": {
        "summary": "Polar webhook handler",
        "operationId": "polarWebhook",
        "description": "Handles incoming Polar webhook events for subscription lifecycle changes. Verifies the webhook signature using webhook-id/timestamp/signature headers against POLAR_WEBHOOK_SECRET. Supported events: subscription.active (activates plan), subscription.canceled (records cancellation), subscription.past_due (marks as past_due), subscription.revoked (downgrades to trial). No auth scope required — webhook signature verification serves as authorization.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "received"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook signature or payload"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Failed to process webhook event (will trigger retry)"
          }
        }
      }
    },
    "/webhooks/whatsapp": {
      "get": {
        "summary": "Verify WhatsApp webhook",
        "operationId": "verifyWhatsAppWebhook",
        "description": "Verifies the WhatsApp webhook URL by checking the verify token and returning the challenge.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "hub.mode",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "hub.verify_token",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "hub.challenge",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook verified successfully",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Verification failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Handle WhatsApp webhook events",
        "operationId": "handleWhatsAppWebhook",
        "description": "Receives and processes incoming WhatsApp messages, media, and interactive responses.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "object": {
                    "type": "string"
                  },
                  "entry": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "object",
                                "properties": {
                                  "messaging_product": {
                                    "type": "string"
                                  },
                                  "metadata": {
                                    "type": "object",
                                    "properties": {
                                      "display_phone_number": {
                                        "type": "string"
                                      },
                                      "phone_number_id": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "contacts": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "profile": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name"
                                          ]
                                        },
                                        "wa_id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "wa_id"
                                      ]
                                    }
                                  },
                                  "messages": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "from": {
                                          "type": "string"
                                        },
                                        "id": {
                                          "type": "string"
                                        },
                                        "timestamp": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string"
                                        },
                                        "text": {
                                          "type": "object",
                                          "properties": {
                                            "body": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "body"
                                          ]
                                        },
                                        "image": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "mime_type": {
                                              "type": "string"
                                            },
                                            "sha256": {
                                              "type": "string"
                                            },
                                            "caption": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "mime_type"
                                          ]
                                        },
                                        "document": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "mime_type": {
                                              "type": "string"
                                            },
                                            "sha256": {
                                              "type": "string"
                                            },
                                            "filename": {
                                              "type": "string"
                                            },
                                            "caption": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "mime_type"
                                          ]
                                        },
                                        "interactive": {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string"
                                            },
                                            "button_reply": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "title": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "title"
                                              ]
                                            },
                                            "list_reply": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "title": {
                                                  "type": "string"
                                                },
                                                "description": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "title"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "type"
                                          ]
                                        },
                                        "context": {
                                          "type": "object",
                                          "properties": {
                                            "from": {
                                              "type": "string"
                                            },
                                            "id": {
                                              "type": "string"
                                            }
                                          }
                                        }
                                      },
                                      "required": [
                                        "from",
                                        "id",
                                        "timestamp",
                                        "type"
                                      ]
                                    }
                                  },
                                  "statuses": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "status": {
                                          "type": "string"
                                        },
                                        "timestamp": {
                                          "type": "string"
                                        },
                                        "recipient_id": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "status",
                                        "timestamp",
                                        "recipient_id"
                                      ]
                                    }
                                  }
                                }
                              },
                              "field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "value",
                              "field"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "changes"
                      ]
                    }
                  }
                },
                "required": [
                  "object",
                  "entry"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Invalid signature",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/stripe": {
      "post": {
        "summary": "Stripe webhook handler",
        "operationId": "stripeWebhook",
        "description": "Handles incoming Stripe Connect webhook events for the invoice payment lifecycle. Verifies the webhook signature using STRIPE_CONNECT_WEBHOOK_SECRET before processing. Supported events: payment_intent.succeeded (marks invoice paid), payment_intent.payment_failed (logs failure), charge.refunded (reverts invoice to unpaid), account.updated (syncs Connect status). Events are persisted to webhook_events with idempotency on stripe_event_id. No auth scope required — signature verification serves as authorization.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "received"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook signature or payload"
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/e-invoicing/storecove": {
      "post": {
        "summary": "Storecove Webhook",
        "operationId": "handleStorecoveWebhook",
        "description": "Handles e-invoice delivery status updates from Storecove",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "document.submitted",
                      "document.sent",
                      "document.delivered",
                      "document.rejected",
                      "document.error"
                    ]
                  },
                  "guid": {
                    "type": "string"
                  },
                  "legal_entity_id": {
                    "type": "number"
                  },
                  "timestamp": {
                    "type": "string"
                  },
                  "document_id": {
                    "type": "string"
                  },
                  "error": {
                    "type": "string"
                  },
                  "rejection_reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "event",
                  "guid",
                  "legal_entity_id",
                  "timestamp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid webhook payload"
          },
          "401": {
            "description": "Invalid webhook signature"
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found"
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/engine/admin/import": {
      "post": {
        "summary": "Trigger Typesense Institution Import",
        "description": "Manually trigger an import of institutions into Typesense. Supports both full and incremental imports. This endpoint requires authentication via API_SECRET_KEY.\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "x-api-secret",
            "in": "header"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "description": "Import options",
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "incremental": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import triggered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "documentsImported": {
                      "type": "number"
                    },
                    "documentsUpdated": {
                      "type": "number"
                    },
                    "documentsSkipped": {
                      "type": "number"
                    },
                    "duration": {
                      "type": "number"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "documentsImported",
                    "documentsUpdated",
                    "documentsSkipped",
                    "duration"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid API secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Import failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/transactions": {
      "get": {
        "summary": "Get transactions",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "teller"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Get transactions by accountId",
              "example": "5341343-4234-4c65-815c-t234213442"
            },
            "required": true,
            "description": "Get transactions by accountId",
            "name": "accountId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "credit",
                "depository"
              ],
              "description": "Get transactions with the correct amount depending on credit or depository",
              "example": "depository"
            },
            "required": true,
            "description": "Get transactions with the correct amount depending on credit or depository",
            "name": "accountType",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "item"
              ],
              "default": "account",
              "description": "Select whether to fetch transactions for a single account or the entire access token (Plaid)",
              "example": "item"
            },
            "required": false,
            "description": "Select whether to fetch transactions for a single account or the entire access token (Plaid)",
            "name": "scope",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "default": false,
              "description": "Get latest transactions",
              "example": "true"
            },
            "required": false,
            "description": "Get latest transactions",
            "name": "latest",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Pagination cursor for syncing transactions (Plaid)",
              "example": "CAESFgoQAB..."
            },
            "required": false,
            "description": "Pagination cursor for syncing transactions (Plaid)",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/transactions/recurring": {
      "get": {
        "summary": "Get recurring transactions",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "plaid"
              ],
              "example": "plaid"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Account ID for Plaid",
              "example": "account-id-123"
            },
            "required": true,
            "description": "Account ID for Plaid",
            "name": "accountId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve recurring transactions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inflow": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account_id": {
                            "type": "string",
                            "example": "acc_123456789"
                          },
                          "stream_id": {
                            "type": "string",
                            "example": "rec_tx_987654321"
                          },
                          "category": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "groceries",
                              "food"
                            ]
                          },
                          "category_id": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string",
                            "example": "Monthly Subscription"
                          },
                          "merchant_name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "Netflix"
                          },
                          "first_date": {
                            "type": "string",
                            "example": "2023-01-15"
                          },
                          "last_date": {
                            "type": "string",
                            "example": "2023-12-15"
                          },
                          "frequency": {
                            "type": "string",
                            "enum": [
                              "weekly",
                              "bi-weekly",
                              "monthly",
                              "yearly",
                              "semi-monthly",
                              "unknown"
                            ],
                            "example": "monthly"
                          },
                          "transaction_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "tx_123",
                              "tx_456",
                              "tx_789"
                            ]
                          },
                          "average_amount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number",
                                "example": 100.5
                              },
                              "iso_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": "USD"
                              },
                              "unofficial_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": null
                              }
                            },
                            "required": [
                              "amount",
                              "iso_currency_code",
                              "unofficial_currency_code"
                            ]
                          },
                          "last_amount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number",
                                "example": 100.5
                              },
                              "iso_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": "USD"
                              },
                              "unofficial_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": null
                              }
                            },
                            "required": [
                              "amount",
                              "iso_currency_code",
                              "unofficial_currency_code"
                            ]
                          },
                          "is_active": {
                            "type": "boolean",
                            "example": true
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "mature",
                              "early_detection",
                              "tombstoned",
                              "unknown"
                            ],
                            "example": "mature"
                          },
                          "personal_finance_category": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "primary": {
                                "type": "string",
                                "example": "FOOD_AND_DRINK"
                              },
                              "detailed": {
                                "type": "string",
                                "example": "RESTAURANTS"
                              },
                              "confidence_level": {
                                "type": "string",
                                "example": "HIGH"
                              }
                            },
                            "required": [
                              "primary",
                              "detailed",
                              "confidence_level"
                            ]
                          },
                          "is_user_modified": {
                            "type": "boolean",
                            "example": false
                          },
                          "last_user_modified_datetime": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": null
                          }
                        },
                        "required": [
                          "account_id",
                          "stream_id",
                          "category",
                          "category_id",
                          "description",
                          "merchant_name",
                          "first_date",
                          "last_date",
                          "frequency",
                          "transaction_ids",
                          "average_amount",
                          "last_amount",
                          "is_active",
                          "status",
                          "personal_finance_category",
                          "is_user_modified",
                          "last_user_modified_datetime"
                        ]
                      }
                    },
                    "outflow": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account_id": {
                            "type": "string",
                            "example": "acc_123456789"
                          },
                          "stream_id": {
                            "type": "string",
                            "example": "rec_tx_987654321"
                          },
                          "category": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "groceries",
                              "food"
                            ]
                          },
                          "category_id": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string",
                            "example": "Monthly Subscription"
                          },
                          "merchant_name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": "Netflix"
                          },
                          "first_date": {
                            "type": "string",
                            "example": "2023-01-15"
                          },
                          "last_date": {
                            "type": "string",
                            "example": "2023-12-15"
                          },
                          "frequency": {
                            "type": "string",
                            "enum": [
                              "weekly",
                              "bi-weekly",
                              "monthly",
                              "yearly",
                              "semi-monthly",
                              "unknown"
                            ],
                            "example": "monthly"
                          },
                          "transaction_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "tx_123",
                              "tx_456",
                              "tx_789"
                            ]
                          },
                          "average_amount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number",
                                "example": 100.5
                              },
                              "iso_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": "USD"
                              },
                              "unofficial_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": null
                              }
                            },
                            "required": [
                              "amount",
                              "iso_currency_code",
                              "unofficial_currency_code"
                            ]
                          },
                          "last_amount": {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number",
                                "example": 100.5
                              },
                              "iso_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": "USD"
                              },
                              "unofficial_currency_code": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "example": null
                              }
                            },
                            "required": [
                              "amount",
                              "iso_currency_code",
                              "unofficial_currency_code"
                            ]
                          },
                          "is_active": {
                            "type": "boolean",
                            "example": true
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "mature",
                              "early_detection",
                              "tombstoned",
                              "unknown"
                            ],
                            "example": "mature"
                          },
                          "personal_finance_category": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "primary": {
                                "type": "string",
                                "example": "FOOD_AND_DRINK"
                              },
                              "detailed": {
                                "type": "string",
                                "example": "RESTAURANTS"
                              },
                              "confidence_level": {
                                "type": "string",
                                "example": "HIGH"
                              }
                            },
                            "required": [
                              "primary",
                              "detailed",
                              "confidence_level"
                            ]
                          },
                          "is_user_modified": {
                            "type": "boolean",
                            "example": false
                          },
                          "last_user_modified_datetime": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "example": null
                          }
                        },
                        "required": [
                          "account_id",
                          "stream_id",
                          "category",
                          "category_id",
                          "description",
                          "merchant_name",
                          "first_date",
                          "last_date",
                          "frequency",
                          "transaction_ids",
                          "average_amount",
                          "last_amount",
                          "is_active",
                          "status",
                          "personal_finance_category",
                          "is_user_modified",
                          "last_user_modified_datetime"
                        ]
                      }
                    },
                    "last_updated_at": {
                      "type": "string",
                      "example": "2023-06-15T14:30:00Z"
                    }
                  },
                  "required": [
                    "inflow",
                    "outflow",
                    "last_updated_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/accounts": {
      "get": {
        "summary": "Get Accounts",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "GoCardLess reference id",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "required": false,
            "description": "GoCardLess reference id",
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "teller"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Plaid institution id",
              "example": "ins_109508"
            },
            "required": false,
            "description": "Plaid institution id",
            "name": "institutionId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountsSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      },
      "delete": {
        "summary": "Delete Accounts",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Account id (GoCardLess)",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "required": false,
            "description": "Account id (GoCardLess)",
            "name": "accountId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "teller"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/accounts/balance": {
      "get": {
        "summary": "Get Account Balance",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Account id",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "required": true,
            "description": "Account id",
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "teller"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve account balance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBalanceSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/institutions": {
      "get": {
        "summary": "Get Institutions",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Search query",
              "example": "Swedbank"
            },
            "required": false,
            "description": "Search query",
            "name": "q",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Limit results",
              "example": "50"
            },
            "required": false,
            "description": "Limit results",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "US",
                "CA",
                "GB",
                "ES",
                "FR",
                "IE",
                "NL",
                "DE",
                "IT",
                "PL",
                "DK",
                "NO",
                "SE",
                "EE",
                "LT",
                "LV",
                "PT",
                "BE",
                "AT",
                "BG",
                "HR",
                "CY",
                "CZ",
                "FI",
                "GR",
                "HU",
                "IS",
                "LI",
                "LU",
                "MT",
                "RO",
                "SK",
                "SI"
              ],
              "description": "Country code",
              "example": "CA"
            },
            "required": true,
            "description": "Country code",
            "name": "countryCode",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve institutions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstitutionsSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/institutions/{id}/usage": {
      "put": {
        "summary": "Update Institution Usage",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "STARLING_SRLGGB3L"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Update institution usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateUsageSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/institutions/:id": {
      "get": {
        "summary": "Get Institution by ID",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "9293961c-df93-4d6d-a2cc-fc3e353b2d10"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve institution by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstitutionSchema"
                }
              }
            }
          },
          "400": {
            "description": "Institution not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Institution not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/auth/plaid/link": {
      "post": {
        "summary": "Auth Link (Plaid)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaidLinkBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retrieve Link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidLinkSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/auth/plaid/exchange": {
      "post": {
        "summary": "Exchange token (Plaid)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaidExchangeBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retrieve Exchange",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaidExchangeSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/auth/gocardless/link": {
      "post": {
        "summary": "Auth link (GoCardLess)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoCardLessLinkBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retrieve Link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoCardLessLinkSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/auth/gocardless/agreement": {
      "post": {
        "summary": "Agreement (GoCardLess)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoCardLessAgreementBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retrieve Agreement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoCardLessAgreementSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/auth/gocardless/exchange": {
      "post": {
        "summary": "Exchange token (GoCardLess)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoCardLessExchangeBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retrieve Exchange",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoCardLessExchangeSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/auth/enablebanking/link": {
      "post": {
        "summary": "Auth link (EnableBanking)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableBankingLinkBodySchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retrieve Link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableBankingLinkResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/auth/enablebanking/exchange": {
      "get": {
        "summary": "Exchange code (EnableBanking)",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "234234234"
            },
            "required": true,
            "name": "code",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve Session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableBankingSessionSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/connections/status": {
      "get": {
        "summary": "Get Connection Status",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "GoCardLess reference id",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "required": false,
            "description": "GoCardLess reference id",
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "teller"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve connection status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatusSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/connections/delete": {
      "delete": {
        "summary": "Delete Connection",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "GoCardLess or Enable Banking reference id",
                    "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "teller",
                      "plaid",
                      "gocardless",
                      "enablebanking",
                      "stripe"
                    ],
                    "example": "teller"
                  }
                },
                "required": [
                  "provider"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ],
        "description": "Authenticated write operations support optional `Idempotency-Key` replay semantics."
      }
    },
    "/engine/connections/gocardless": {
      "get": {
        "summary": "Get GoCardless Connections",
        "responses": {
          "200": {
            "description": "Retrieve GoCardless connections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "number"
                    },
                    "next": {
                      "type": "string"
                    },
                    "previous": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "created": {
                            "type": "string"
                          },
                          "redirect": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "CR",
                              "GC",
                              "UA",
                              "RJ",
                              "SA",
                              "GA",
                              "LN",
                              "EX"
                            ]
                          },
                          "institution_id": {
                            "type": "string"
                          },
                          "agreement": {
                            "type": "string"
                          },
                          "reference": {
                            "type": "string"
                          },
                          "accounts": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "user_language": {
                            "type": "string"
                          },
                          "link": {
                            "type": "string"
                          },
                          "ssn": {
                            "type": "string"
                          },
                          "account_selection": {
                            "type": "boolean"
                          },
                          "redirect_immediate": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "created",
                          "redirect",
                          "status",
                          "institution_id",
                          "agreement",
                          "reference",
                          "accounts",
                          "user_language",
                          "link",
                          "ssn",
                          "account_selection",
                          "redirect_immediate"
                        ]
                      }
                    }
                  },
                  "required": [
                    "count",
                    "next",
                    "previous",
                    "results"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/connections/:reference": {
      "get": {
        "summary": "Get Connection by Reference",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}(?::[A-Za-z0-9_-]{1,64})?$/i",
              "description": "GoCardLess reference id in the expected workspace-prefixed format.",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6:reconnect_123"
            },
            "required": true,
            "description": "GoCardLess reference id in the expected workspace-prefixed format.",
            "name": "reference",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve connection by reference",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "accounts": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "accounts"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Connection not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/health": {
      "get": {
        "summary": "Health",
        "responses": {
          "200": {
            "description": "Retrieve health",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Service unhealthy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthSchema"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/rates": {
      "get": {
        "summary": "Get rates",
        "responses": {
          "200": {
            "description": "Retrieve rates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RatesSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "internal_server_error"
                    },
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "internal_server_error"
                    },
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/rates/:type": {
      "get": {
        "summary": "Get rates by type",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Currency code to filter rates by (e.g., USD, EUR)",
              "example": "USD"
            },
            "required": true,
            "description": "Currency code to filter rates by (e.g., USD, EUR)",
            "name": "type",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve rates by type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateTypeSchema"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "internal_server_error"
                    },
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "internal_server_error"
                    },
                    "message": {
                      "type": "string",
                      "example": "Internal server error"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/statements": {
      "get": {
        "summary": "Get statements",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "plaid"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Account ID",
              "example": "5f7a7464d6e268055f17e3a5"
            },
            "required": true,
            "description": "Account ID",
            "name": "accountId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "User ID",
              "example": "user_12345"
            },
            "required": true,
            "description": "User ID",
            "name": "userId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Team ID",
              "example": "team_67890"
            },
            "required": true,
            "description": "Team ID",
            "name": "teamId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve statements",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account_id": {
                            "type": "string",
                            "example": "acc_123456789"
                          },
                          "statement_id": {
                            "type": "string",
                            "example": "stmt_987654321"
                          },
                          "month": {
                            "type": "string",
                            "example": "01"
                          },
                          "year": {
                            "type": "string",
                            "example": "2024"
                          }
                        },
                        "required": [
                          "account_id",
                          "statement_id",
                          "month",
                          "year"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/engine/statements/pdf": {
      "get": {
        "summary": "Get statement PDF",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "teller",
                "plaid",
                "gocardless",
                "enablebanking",
                "stripe"
              ],
              "example": "plaid"
            },
            "required": true,
            "name": "provider",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Statement ID",
              "example": "abcdef123456"
            },
            "required": true,
            "description": "Statement ID",
            "name": "statementId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Account ID",
              "example": "5f7a7464d6e268055f17e3a5"
            },
            "required": true,
            "description": "Account ID",
            "name": "accountId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "User ID",
              "example": "user_12345"
            },
            "required": true,
            "description": "User ID",
            "name": "userId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Team ID",
              "example": "team_67890"
            },
            "required": true,
            "description": "Team ID",
            "name": "teamId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches."
            },
            "required": false,
            "description": "Provider access token transport for engine routes. Query-string accessToken values are rejected to avoid leaking secrets into URLs, logs, and caches.",
            "name": "x-provider-access-token",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve statement PDF",
            "headers": {
              "Content-Type": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "application/pdf"
                  ]
                },
                "required": true
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                },
                "required": true
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/StatementPdfResponse"
                }
              }
            }
          },
          "400": {
            "description": "Returns an error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "disconnected"
                    },
                    "message": {
                      "type": "string",
                      "example": "The login details of this item have changed (credentials, MFA, or required user action) and a user login is required to update this information."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "def": {
                    "type": "object",
                    "shape": {
                      "error": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "message": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "description": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "requestId": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "string"
                            },
                            "type": "string",
                            "format": null,
                            "minLength": null,
                            "maxLength": null
                          }
                        },
                        "type": "optional"
                      },
                      "retryAfterSeconds": {
                        "def": {
                          "type": "optional",
                          "innerType": {
                            "def": {
                              "type": "number",
                              "checks": [
                                {
                                  "def": {
                                    "type": "number",
                                    "check": "number_format",
                                    "abort": false,
                                    "format": "safeint"
                                  },
                                  "type": "number",
                                  "minValue": -9007199254740991,
                                  "maxValue": 9007199254740991,
                                  "isInt": true,
                                  "isFinite": true,
                                  "format": "safeint"
                                }
                              ]
                            },
                            "type": "number",
                            "minValue": -9007199254740991,
                            "maxValue": 9007199254740991,
                            "isInt": true,
                            "isFinite": true,
                            "format": "safeint"
                          }
                        },
                        "type": "optional"
                      }
                    }
                  },
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": []
          },
          {
            "token": []
          }
        ]
      }
    },
    "/notifications": {
      "get": {
        "summary": "List all notifications",
        "operationId": "listNotifications",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a paginated list of notifications for the authenticated user within their team. Notifications are always scoped to the calling user — you cannot read another user's notifications. Supports filtering by status (read/unread) and cursor-based pagination.\n\nRequired scopes: notifications.read",
        "tags": [
          "Notifications"
        ],
        "x-oppulence-required-scopes": [
          "notifications.read"
        ],
        "security": [
          {
            "oauth2": [
              "notifications.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Cursor for pagination, representing the last item from the previous page",
              "example": "20"
            },
            "required": false,
            "description": "Cursor for pagination, representing the last item from the previous page",
            "in": "query",
            "name": "cursor"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Number of notifications to return per page (1-100)",
              "example": 20
            },
            "required": false,
            "description": "Number of notifications to return per page (1-100)",
            "in": "query",
            "name": "pageSize"
          },
          {
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "enum": [
                    "unread",
                    "read",
                    "archived"
                  ]
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "unread",
                      "read",
                      "archived"
                    ]
                  }
                }
              ],
              "description": "Filter by notification status. Can be a single status or array of statuses. unread = new notifications, read = viewed but not dismissed, archived = dismissed from view",
              "example": [
                "unread",
                "read"
              ]
            },
            "required": false,
            "description": "Filter by notification status. Can be a single status or array of statuses. unread = new notifications, read = viewed but not dismissed, archived = dismissed from view",
            "in": "query",
            "name": "status"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid",
              "description": "Filter notifications by specific user ID",
              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
            },
            "required": false,
            "description": "Filter notifications by specific user ID",
            "in": "query",
            "name": "userId"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1,
              "maximum": 10,
              "description": "Filter notifications by priority level (1-10)",
              "example": 5
            },
            "required": false,
            "description": "Filter notifications by priority level (1-10)",
            "in": "query",
            "name": "priority"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1,
              "maximum": 10,
              "description": "Filter notifications by maximum priority level (priority <= maxPriority). Use 3 for user-facing notifications only.",
              "example": 3
            },
            "required": false,
            "description": "Filter notifications by maximum priority level (priority <= maxPriority). Use 3 for user-facing notifications only.",
            "in": "query",
            "name": "maxPriority"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of notifications for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page of results, null if no more pages",
                          "example": "eyJ0eXBlIjoib2Zmc2V0Iiwib2Zmc2V0IjoyNX0"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there are results on the previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there are more results on the next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NotificationSchema"
                      },
                      "description": "Array of notifications"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ],
                  "description": "Paginated notifications response"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/{notificationId}/status": {
      "patch": {
        "summary": "Update notification status",
        "operationId": "updateNotificationStatus",
        "x-speakeasy-name-override": "updateStatus",
        "description": "Update the read/unread status of a single notification by its UUID. The notification must belong to the authenticated user and team. Returns 404 if the notification is not found or belongs to a different user.\n\nRequired scopes: notifications.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Notifications"
        ],
        "x-oppulence-required-scopes": [
          "notifications.write"
        ],
        "security": [
          {
            "oauth2": [
              "notifications.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The ID of the notification to update",
              "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
            },
            "required": true,
            "description": "The ID of the notification to update",
            "in": "path",
            "name": "notificationId"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "unread",
                      "read",
                      "archived"
                    ],
                    "description": "The new status for the notification",
                    "example": "read"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Notification status updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/notifications/update-all-status": {
      "post": {
        "summary": "Update status of all notifications",
        "operationId": "updateAllNotificationsStatus",
        "x-speakeasy-name-override": "updateAllStatus",
        "description": "Bulk-update the status of all notifications for the authenticated user within their team. Commonly used to mark all notifications as read. Returns the count of updated notifications.\n\nRequired scopes: notifications.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Notifications"
        ],
        "x-oppulence-required-scopes": [
          "notifications.write"
        ],
        "security": [
          {
            "oauth2": [
              "notifications.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAllNotificationsStatusSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All notifications status updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateAllNotificationsStatusResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/transactions": {
      "get": {
        "summary": "List all transactions",
        "operationId": "listTransactions",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a paginated list of transactions for the authenticated team. Supports filtering by date range, category, bank account, status, and text search. Each transaction includes amount, currency, category, and bank account details.\n\nRequired scopes: transactions.read",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.read"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Cursor for pagination, representing the last item from the previous page",
              "example": "eyJpZCI6IjEyMyJ9"
            },
            "required": false,
            "description": "Cursor for pagination, representing the last item from the previous page",
            "in": "query",
            "name": "cursor"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "prefixItems": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Sorting order as a tuple: [field, direction]. Example: ['date', 'desc'] or ['amount', 'asc']",
              "example": [
                "date",
                "desc"
              ]
            },
            "required": false,
            "description": "Sorting order as a tuple: [field, direction]. Example: ['date', 'desc'] or ['amount', 'asc']",
            "in": "query",
            "name": "sort"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 10000,
              "description": "Number of transactions to return per page (1-10000)",
              "example": 50
            },
            "required": false,
            "description": "Number of transactions to return per page (1-10000)",
            "in": "query",
            "name": "pageSize"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "When true, returns only transactions that need review: those with a pending receipt-match suggestion, or that are unfulfilled (no attachment and not completed) and not excluded/archived."
            },
            "required": false,
            "description": "When true, returns only transactions that need review: those with a pending receipt-match suggestion, or that are unfulfilled (no attachment and not completed) and not excluded/archived.",
            "in": "query",
            "name": "needsReview"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Search query string to filter transactions by name, description, or other text fields",
              "example": "office supplies"
            },
            "required": false,
            "description": "Search query string to filter transactions by name, description, or other text fields",
            "in": "query",
            "name": "q"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of category slugs to filter transactions by specific categories",
              "example": [
                "office-supplies",
                "travel"
              ]
            },
            "required": false,
            "description": "Array of category slugs to filter transactions by specific categories",
            "in": "query",
            "name": "categories"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of tag IDs to filter transactions by specific tags",
              "example": [
                "tag-1",
                "tag-2"
              ]
            },
            "required": false,
            "description": "Array of tag IDs to filter transactions by specific tags",
            "in": "query",
            "name": "tags"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Start date (inclusive) for filtering transactions in ISO 8601 format",
              "example": "2024-04-01T00:00:00.000Z"
            },
            "required": false,
            "description": "Start date (inclusive) for filtering transactions in ISO 8601 format",
            "in": "query",
            "name": "start"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "End date (inclusive) for filtering transactions in ISO 8601 format",
              "example": "2024-04-30T23:59:59.999Z"
            },
            "required": false,
            "description": "End date (inclusive) for filtering transactions in ISO 8601 format",
            "in": "query",
            "name": "end"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of bank account IDs to filter transactions by specific accounts",
              "example": [
                "account-1",
                "account-2"
              ]
            },
            "required": false,
            "description": "Array of bank account IDs to filter transactions by specific accounts",
            "in": "query",
            "name": "accounts"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of user IDs to filter transactions by assigned users",
              "example": [
                "user-1",
                "user-2"
              ]
            },
            "required": false,
            "description": "Array of user IDs to filter transactions by assigned users",
            "in": "query",
            "name": "assignees"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of transaction statuses to filter by. Available statuses: 'pending', 'completed', 'archived', 'posted', 'excluded'",
              "example": [
                "pending",
                "completed"
              ]
            },
            "required": false,
            "description": "Array of transaction statuses to filter by. Available statuses: 'pending', 'completed', 'archived', 'posted', 'excluded'",
            "in": "query",
            "name": "statuses"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of recurring frequency values to filter by. Available frequencies: 'weekly', 'monthly', 'annually', 'irregular'",
              "example": [
                "monthly",
                "annually"
              ]
            },
            "required": false,
            "description": "Array of recurring frequency values to filter by. Available frequencies: 'weekly', 'monthly', 'annually', 'irregular'",
            "in": "query",
            "name": "recurring"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "include",
                "exclude",
                null
              ],
              "description": "Filter transactions based on attachment presence. 'include' returns only transactions with attachments, 'exclude' returns only transactions without attachments",
              "example": "include"
            },
            "required": false,
            "description": "Filter transactions based on attachment presence. 'include' returns only transactions with attachments, 'exclude' returns only transactions without attachments",
            "in": "query",
            "name": "attachments"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "include",
                "exclude",
                null
              ],
              "description": "Filter transactions based on whether they were manually imported. 'include' returns only manual transactions, 'exclude' returns only non-manual transactions",
              "example": "include"
            },
            "required": false,
            "description": "Filter transactions based on whether they were manually imported. 'include' returns only manual transactions, 'exclude' returns only non-manual transactions",
            "in": "query",
            "name": "manual"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "description": "Amount range as [min, max] to filter transactions by monetary value",
              "example": [
                100,
                1000
              ]
            },
            "required": false,
            "description": "Amount range as [min, max] to filter transactions by monetary value",
            "in": "query",
            "name": "amountRange"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of specific amounts (as strings) to filter transactions by exact values",
              "example": [
                "150.75",
                "299.99"
              ]
            },
            "required": false,
            "description": "Array of specific amounts (as strings) to filter transactions by exact values",
            "in": "query",
            "name": "amount"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "income",
                "expense",
                null
              ],
              "description": "Transaction type to filter by. 'income' for money received, 'expense' for money spent",
              "example": "expense"
            },
            "required": false,
            "description": "Transaction type to filter by. 'income' for money received, 'expense' for money spent",
            "in": "query",
            "name": "type"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of transactions for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page of results, null if no more pages",
                          "example": "eyJ0eXBlIjoib2Zmc2V0Iiwib2Zmc2V0IjoyNX0"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there are results on the previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there are more results on the next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata for the transactions response"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TransactionResponse"
                      },
                      "description": "Array of transactions matching the query criteria"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ],
                  "description": "Paginated transactions response"
                },
                "example": {
                  "meta": {
                    "cursor": "eyJpZCI6IjQ1NiJ9",
                    "hasPreviousPage": false,
                    "hasNextPage": true
                  },
                  "data": [
                    {
                      "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                      "internalId": "txn_20240501_001",
                      "name": "Office Supplies Purchase",
                      "amount": 150.75,
                      "balance": 1250.55,
                      "baseAmount": 150.75,
                      "baseCurrency": "USD",
                      "taxAmount": 15.07,
                      "taxRate": 10,
                      "taxType": "VAT",
                      "currency": "USD",
                      "counterpartyName": "Staples",
                      "merchantName": "Staples",
                      "date": "2024-05-01T12:00:00.000Z",
                      "category": {
                        "id": "office-supplies",
                        "name": "Office Supplies",
                        "color": "#FF5733",
                        "taxRate": 10,
                        "taxType": "VAT",
                        "slug": "office-supplies"
                      },
                      "status": "completed",
                      "internal": false,
                      "recurring": false,
                      "manual": true,
                      "frequency": null,
                      "isFulfilled": true,
                      "note": "Paid with company credit card",
                      "metadata": {
                        "categoryHint": "office-supplies",
                        "confidenceScore": 0.92
                      },
                      "metadataCompleted": true,
                      "notified": false,
                      "account": {
                        "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                        "name": "Company Credit Card",
                        "currency": "USD",
                        "connection": {
                          "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                          "name": "Chase Bank",
                          "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                        }
                      },
                      "tags": [
                        {
                          "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                          "name": "invoice"
                        }
                      ],
                      "attachments": [
                        {
                          "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                          "path": [
                            "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                            "transactions",
                            "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                            "receipt.pdf"
                          ],
                          "size": 1928716,
                          "type": "application/pdf",
                          "filename": "receipt.pdf"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a transaction",
        "operationId": "createTransaction",
        "x-speakeasy-name-override": "create",
        "description": "Create a new transaction for the authenticated team. Provide amount, currency, date, and optionally assign a category, bank account, or attach files (must reference previously uploaded files).\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Create a new transaction for the authenticated team. Attachments should reference previously uploaded files.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the transaction."
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount of the transaction."
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency of the transaction."
                  },
                  "date": {
                    "type": "string",
                    "description": "Date of the transaction (ISO 8601)."
                  },
                  "bankAccountId": {
                    "type": "string",
                    "description": "Bank account ID associated with the transaction."
                  },
                  "assignedId": {
                    "type": "string",
                    "description": "Assigned user ID for the transaction."
                  },
                  "categorySlug": {
                    "type": "string",
                    "description": "Category slug for the transaction."
                  },
                  "note": {
                    "type": "string",
                    "description": "Note for the transaction."
                  },
                  "internal": {
                    "type": "boolean",
                    "description": "Whether the transaction is internal."
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Path(s) of the attachment file(s)."
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the attachment file."
                        },
                        "size": {
                          "type": "number",
                          "description": "Size of the attachment file in bytes."
                        },
                        "type": {
                          "type": "string",
                          "description": "MIME type of the attachment file."
                        }
                      },
                      "required": [
                        "path",
                        "name",
                        "size",
                        "type"
                      ]
                    },
                    "description": "Array of attachments for the transaction."
                  }
                },
                "required": [
                  "name",
                  "amount",
                  "currency",
                  "date",
                  "bankAccountId"
                ],
                "description": "Payload for creating a single transaction.",
                "example": {
                  "name": "Office Supplies Purchase",
                  "amount": 150.75,
                  "currency": "USD",
                  "date": "2024-05-01T12:00:00.000Z",
                  "bankAccountId": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                  "assignedId": "c84749ef-9875-48f0-b32f-b75d3c555925",
                  "categorySlug": "office-supplies",
                  "note": "Paid with company credit card",
                  "internal": false,
                  "attachments": [
                    {
                      "path": [
                        "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                        "transactions",
                        "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                        "receipt.pdf"
                      ],
                      "name": "receipt.pdf",
                      "size": 1928716,
                      "type": "application/pdf"
                    }
                  ]
                }
              },
              "example": {
                "name": "Office Supplies Purchase",
                "amount": 150.75,
                "currency": "USD",
                "date": "2024-05-01T12:00:00.000Z",
                "bankAccountId": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                "assignedId": "c84749ef-9875-48f0-b32f-b75d3c555925",
                "categorySlug": "office-supplies",
                "note": "Paid with company credit card",
                "internal": false,
                "attachments": [
                  {
                    "path": [
                      "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                      "transactions",
                      "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                      "receipt.pdf"
                    ],
                    "name": "receipt.pdf",
                    "size": 1928716,
                    "type": "application/pdf"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponse"
                },
                "example": {
                  "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                  "internalId": "txn_20240501_001",
                  "name": "Office Supplies Purchase",
                  "amount": 150.75,
                  "balance": 1250.55,
                  "baseAmount": 150.75,
                  "baseCurrency": "USD",
                  "taxAmount": 15.07,
                  "taxRate": 10,
                  "taxType": "VAT",
                  "currency": "USD",
                  "counterpartyName": "Staples",
                  "merchantName": "Staples",
                  "date": "2024-05-01T12:00:00.000Z",
                  "category": {
                    "id": "office-supplies",
                    "name": "Office Supplies",
                    "color": "#FF5733",
                    "taxRate": 10,
                    "taxType": "VAT",
                    "slug": "office-supplies"
                  },
                  "status": "completed",
                  "internal": false,
                  "recurring": false,
                  "manual": true,
                  "frequency": null,
                  "isFulfilled": true,
                  "note": "Paid with company credit card",
                  "metadata": {
                    "categoryHint": "office-supplies",
                    "confidenceScore": 0.92
                  },
                  "metadataCompleted": true,
                  "notified": false,
                  "account": {
                    "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                    "name": "Company Credit Card",
                    "currency": "USD",
                    "connection": {
                      "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                      "name": "Chase Bank",
                      "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                    }
                  },
                  "tags": [
                    {
                      "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                      "name": "invoice"
                    }
                  ],
                  "attachments": [
                    {
                      "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                      "path": [
                        "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                        "transactions",
                        "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                        "receipt.pdf"
                      ],
                      "size": 1928716,
                      "type": "application/pdf",
                      "filename": "receipt.pdf"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/transactions/{id}": {
      "get": {
        "summary": "Retrieve a transaction",
        "operationId": "getTransactionById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single transaction by its UUID. Returns the full transaction record including amount, currency, date, category, bank account, and attachment details. The transaction must belong to the authenticated team.\n\nRequired scopes: transactions.read",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.read"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Transaction ID (UUID)."
            },
            "required": true,
            "description": "Transaction ID (UUID).",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponse"
                },
                "example": {
                  "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                  "internalId": "txn_20240501_001",
                  "name": "Office Supplies Purchase",
                  "amount": 150.75,
                  "balance": 1250.55,
                  "baseAmount": 150.75,
                  "baseCurrency": "USD",
                  "taxAmount": 15.07,
                  "taxRate": 10,
                  "taxType": "VAT",
                  "currency": "USD",
                  "counterpartyName": "Staples",
                  "merchantName": "Staples",
                  "date": "2024-05-01T12:00:00.000Z",
                  "category": {
                    "id": "office-supplies",
                    "name": "Office Supplies",
                    "color": "#FF5733",
                    "taxRate": 10,
                    "taxType": "VAT",
                    "slug": "office-supplies"
                  },
                  "status": "completed",
                  "internal": false,
                  "recurring": false,
                  "manual": true,
                  "frequency": null,
                  "isFulfilled": true,
                  "note": "Paid with company credit card",
                  "metadata": {
                    "categoryHint": "office-supplies",
                    "confidenceScore": 0.92
                  },
                  "metadataCompleted": true,
                  "notified": false,
                  "account": {
                    "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                    "name": "Company Credit Card",
                    "currency": "USD",
                    "connection": {
                      "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                      "name": "Chase Bank",
                      "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                    }
                  },
                  "tags": [
                    {
                      "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                      "name": "invoice"
                    }
                  ],
                  "attachments": [
                    {
                      "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                      "path": [
                        "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                        "transactions",
                        "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                        "receipt.pdf"
                      ],
                      "size": 1928716,
                      "type": "application/pdf",
                      "filename": "receipt.pdf"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a transaction",
        "operationId": "updateTransaction",
        "x-speakeasy-name-override": "update",
        "description": "Update a single transaction by its UUID. Only provided fields are modified; omitted fields remain unchanged. If no changes are detected, returns the transaction as-is. The transaction must belong to the authenticated team.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Transaction ID (UUID)."
            },
            "required": true,
            "description": "Transaction ID (UUID).",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "description": "Update mutable fields on a single transaction. Omitted fields remain unchanged.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name/description of the transaction."
                  },
                  "amount": {
                    "type": "number",
                    "description": "Amount of the transaction."
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency of the transaction."
                  },
                  "date": {
                    "type": "string",
                    "description": "Date of the transaction (ISO 8601)."
                  },
                  "bankAccountId": {
                    "type": "string",
                    "description": "Bank account ID associated with the transaction."
                  },
                  "categorySlug": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Category slug for the transaction."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "pending",
                      "archived",
                      "completed",
                      "posted",
                      "excluded",
                      null
                    ],
                    "description": "Status of the transaction."
                  },
                  "internal": {
                    "type": "boolean",
                    "description": "Whether the transaction is internal."
                  },
                  "recurring": {
                    "type": "boolean",
                    "description": "Whether the transaction is recurring."
                  },
                  "frequency": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "weekly",
                      "monthly",
                      "annually",
                      "irregular",
                      null
                    ],
                    "description": "Recurring frequency of the transaction."
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Note for the transaction."
                  },
                  "assignedId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Assigned user ID for the transaction."
                  },
                  "taxRate": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Tax rate as a percentage (e.g., 25 for 25% VAT). Only set when tax is calculated from a percentage."
                  },
                  "taxAmount": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Tax amount in the transaction currency. Always set when tax is present."
                  }
                }
              },
              "example": {
                "name": "Office Supplies Purchase (Updated)",
                "categorySlug": "office-supplies",
                "status": "completed",
                "note": "Reviewed by finance",
                "assignedId": "c84749ef-9875-48f0-b32f-b75d3c555925",
                "recurring": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponse"
                },
                "example": {
                  "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                  "internalId": "txn_20240501_001",
                  "name": "Office Supplies Purchase",
                  "amount": 150.75,
                  "balance": 1250.55,
                  "baseAmount": 150.75,
                  "baseCurrency": "USD",
                  "taxAmount": 15.07,
                  "taxRate": 10,
                  "taxType": "VAT",
                  "currency": "USD",
                  "counterpartyName": "Staples",
                  "merchantName": "Staples",
                  "date": "2024-05-01T12:00:00.000Z",
                  "category": {
                    "id": "office-supplies",
                    "name": "Office Supplies",
                    "color": "#FF5733",
                    "taxRate": 10,
                    "taxType": "VAT",
                    "slug": "office-supplies"
                  },
                  "status": "completed",
                  "internal": false,
                  "recurring": false,
                  "manual": true,
                  "frequency": null,
                  "isFulfilled": true,
                  "note": "Paid with company credit card",
                  "metadata": {
                    "categoryHint": "office-supplies",
                    "confidenceScore": 0.92
                  },
                  "metadataCompleted": true,
                  "notified": false,
                  "account": {
                    "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                    "name": "Company Credit Card",
                    "currency": "USD",
                    "connection": {
                      "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                      "name": "Chase Bank",
                      "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                    }
                  },
                  "tags": [
                    {
                      "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                      "name": "invoice"
                    }
                  ],
                  "attachments": [
                    {
                      "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                      "path": [
                        "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                        "transactions",
                        "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                        "receipt.pdf"
                      ],
                      "size": 1928716,
                      "type": "application/pdf",
                      "filename": "receipt.pdf"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a transaction",
        "operationId": "deleteTransaction",
        "x-speakeasy-name-override": "delete",
        "description": "Delete a single manually created transaction by its UUID. Bank-synced transactions cannot be deleted — use the update endpoint to exclude them instead. Returns the deleted transaction's ID on success.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Transaction ID (UUID)."
            },
            "required": true,
            "description": "Transaction ID (UUID).",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Transaction ID (UUID)."
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "description": "Delete confirmation payload for a single transaction.",
                  "example": {
                    "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                  }
                },
                "example": {
                  "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/bulk": {
      "patch": {
        "summary": "Bulk update transactions",
        "operationId": "updateTransactions",
        "x-speakeasy-name-override": "updateMany",
        "description": "Bulk update multiple transactions in a single operation. Provide a list of transaction IDs and the fields to apply. If no changes are needed, returns the transactions unchanged. All targeted transactions must belong to the authenticated team.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Update one or more fields for a set of transactions. Provide the list of IDs to update and the fields to apply.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of transaction IDs to update."
                  },
                  "categorySlug": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Category slug for the transactions."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "pending",
                      "archived",
                      "completed",
                      "posted",
                      "excluded",
                      null
                    ],
                    "description": "Status to set for the transactions."
                  },
                  "frequency": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "weekly",
                      "monthly",
                      "annually",
                      "irregular",
                      null
                    ],
                    "description": "Recurring frequency to set for the transactions."
                  },
                  "internal": {
                    "type": "boolean",
                    "description": "Whether the transactions are internal."
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Note to set for the transactions."
                  },
                  "assignedId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Assigned user ID for the transactions."
                  },
                  "recurring": {
                    "type": "boolean",
                    "description": "Whether the transactions are recurring."
                  },
                  "tagId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Tag ID to set for the transactions."
                  }
                },
                "required": [
                  "ids"
                ],
                "description": "Payload for bulk-updating transactions.",
                "example": {
                  "ids": [
                    "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                    "c3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                  ],
                  "categorySlug": "office-supplies",
                  "status": "completed",
                  "note": "Reviewed by finance",
                  "tagId": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b"
                }
              },
              "example": {
                "ids": [
                  "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                  "c3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                ],
                "categorySlug": "office-supplies",
                "status": "completed",
                "note": "Reviewed by finance",
                "tagId": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transactions updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page of results, null if no more pages",
                          "example": "eyJ0eXBlIjoib2Zmc2V0Iiwib2Zmc2V0IjoyNX0"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there are results on the previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there are more results on the next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata for the transactions response"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TransactionResponse"
                      },
                      "description": "Array of transactions matching the query criteria"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ],
                  "description": "Paginated transactions response"
                },
                "example": {
                  "meta": {
                    "cursor": "eyJpZCI6IjQ1NiJ9",
                    "hasPreviousPage": false,
                    "hasNextPage": true
                  },
                  "data": [
                    {
                      "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                      "internalId": "txn_20240501_001",
                      "name": "Office Supplies Purchase",
                      "amount": 150.75,
                      "balance": 1250.55,
                      "baseAmount": 150.75,
                      "baseCurrency": "USD",
                      "taxAmount": 15.07,
                      "taxRate": 10,
                      "taxType": "VAT",
                      "currency": "USD",
                      "counterpartyName": "Staples",
                      "merchantName": "Staples",
                      "date": "2024-05-01T12:00:00.000Z",
                      "category": {
                        "id": "office-supplies",
                        "name": "Office Supplies",
                        "color": "#FF5733",
                        "taxRate": 10,
                        "taxType": "VAT",
                        "slug": "office-supplies"
                      },
                      "status": "completed",
                      "internal": false,
                      "recurring": false,
                      "manual": true,
                      "frequency": null,
                      "isFulfilled": true,
                      "note": "Paid with company credit card",
                      "metadata": {
                        "categoryHint": "office-supplies",
                        "confidenceScore": 0.92
                      },
                      "metadataCompleted": true,
                      "notified": false,
                      "account": {
                        "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                        "name": "Company Credit Card",
                        "currency": "USD",
                        "connection": {
                          "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                          "name": "Chase Bank",
                          "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                        }
                      },
                      "tags": [
                        {
                          "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                          "name": "invoice"
                        }
                      ],
                      "attachments": [
                        {
                          "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                          "path": [
                            "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                            "transactions",
                            "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                            "receipt.pdf"
                          ],
                          "size": 1928716,
                          "type": "application/pdf",
                          "filename": "receipt.pdf"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "post": {
        "summary": "Bulk create transactions",
        "operationId": "createTransactions",
        "x-speakeasy-name-override": "createMany",
        "description": "Create multiple transactions in a single bulk operation. Accepts up to 100 transactions per request. Each transaction is associated with the authenticated user and team.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Create multiple transactions in a single request. Max 100 items.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Name of the transaction."
                    },
                    "amount": {
                      "type": "number",
                      "description": "Amount of the transaction."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency of the transaction."
                    },
                    "date": {
                      "type": "string",
                      "description": "Date of the transaction (ISO 8601)."
                    },
                    "bankAccountId": {
                      "type": "string",
                      "description": "Bank account ID associated with the transaction."
                    },
                    "assignedId": {
                      "type": "string",
                      "description": "Assigned user ID for the transaction."
                    },
                    "categorySlug": {
                      "type": "string",
                      "description": "Category slug for the transaction."
                    },
                    "note": {
                      "type": "string",
                      "description": "Note for the transaction."
                    },
                    "internal": {
                      "type": "boolean",
                      "description": "Whether the transaction is internal."
                    },
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Path(s) of the attachment file(s)."
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the attachment file."
                          },
                          "size": {
                            "type": "number",
                            "description": "Size of the attachment file in bytes."
                          },
                          "type": {
                            "type": "string",
                            "description": "MIME type of the attachment file."
                          }
                        },
                        "required": [
                          "path",
                          "name",
                          "size",
                          "type"
                        ]
                      },
                      "description": "Array of attachments for the transaction."
                    }
                  },
                  "required": [
                    "name",
                    "amount",
                    "currency",
                    "date",
                    "bankAccountId"
                  ],
                  "description": "Payload for creating a single transaction.",
                  "example": {
                    "name": "Office Supplies Purchase",
                    "amount": 150.75,
                    "currency": "USD",
                    "date": "2024-05-01T12:00:00.000Z",
                    "bankAccountId": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                    "assignedId": "c84749ef-9875-48f0-b32f-b75d3c555925",
                    "categorySlug": "office-supplies",
                    "note": "Paid with company credit card",
                    "internal": false,
                    "attachments": [
                      {
                        "path": [
                          "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                          "transactions",
                          "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                          "receipt.pdf"
                        ],
                        "name": "receipt.pdf",
                        "size": 1928716,
                        "type": "application/pdf"
                      }
                    ]
                  }
                },
                "minItems": 1,
                "maxItems": 100,
                "description": "List of transactions to create.",
                "example": [
                  {
                    "name": "Office Supplies Purchase",
                    "amount": 150.75,
                    "currency": "USD",
                    "date": "2024-05-01T12:00:00.000Z",
                    "bankAccountId": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                    "assignedId": "c84749ef-9875-48f0-b32f-b75d3c555925",
                    "categorySlug": "office-supplies",
                    "note": "Paid with company credit card",
                    "internal": false,
                    "attachments": [
                      {
                        "path": [
                          "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                          "transactions",
                          "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                          "receipt.pdf"
                        ],
                        "name": "receipt.pdf",
                        "size": 1928716,
                        "type": "application/pdf"
                      }
                    ]
                  }
                ]
              },
              "example": [
                {
                  "name": "Office Supplies Purchase",
                  "amount": 150.75,
                  "currency": "USD",
                  "date": "2024-05-01T12:00:00.000Z",
                  "bankAccountId": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                  "assignedId": "c84749ef-9875-48f0-b32f-b75d3c555925",
                  "categorySlug": "office-supplies",
                  "note": "Paid with company credit card",
                  "internal": false,
                  "attachments": [
                    {
                      "path": [
                        "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                        "transactions",
                        "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                        "receipt.pdf"
                      ],
                      "name": "receipt.pdf",
                      "size": 1928716,
                      "type": "application/pdf"
                    }
                  ]
                }
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transactions created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TransactionResponse"
                  },
                  "description": "Response payload for bulk transaction creation.",
                  "example": [
                    {
                      "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                      "internalId": "txn_20240501_001",
                      "name": "Office Supplies Purchase",
                      "amount": 150.75,
                      "balance": 1250.55,
                      "baseAmount": 150.75,
                      "baseCurrency": "USD",
                      "taxAmount": 15.07,
                      "taxRate": 10,
                      "taxType": "VAT",
                      "currency": "USD",
                      "counterpartyName": "Staples",
                      "merchantName": "Staples",
                      "date": "2024-05-01T12:00:00.000Z",
                      "category": {
                        "id": "office-supplies",
                        "name": "Office Supplies",
                        "color": "#FF5733",
                        "taxRate": 10,
                        "taxType": "VAT",
                        "slug": "office-supplies"
                      },
                      "status": "completed",
                      "internal": false,
                      "recurring": false,
                      "manual": true,
                      "frequency": null,
                      "isFulfilled": true,
                      "note": "Paid with company credit card",
                      "metadata": {
                        "categoryHint": "office-supplies",
                        "confidenceScore": 0.92
                      },
                      "metadataCompleted": true,
                      "notified": false,
                      "account": {
                        "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                        "name": "Company Credit Card",
                        "currency": "USD",
                        "connection": {
                          "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                          "name": "Chase Bank",
                          "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                        }
                      },
                      "tags": [
                        {
                          "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                          "name": "invoice"
                        }
                      ],
                      "attachments": [
                        {
                          "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                          "path": [
                            "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                            "transactions",
                            "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                            "receipt.pdf"
                          ],
                          "size": 1928716,
                          "type": "application/pdf",
                          "filename": "receipt.pdf"
                        }
                      ]
                    }
                  ]
                },
                "example": [
                  {
                    "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                    "internalId": "txn_20240501_001",
                    "name": "Office Supplies Purchase",
                    "amount": 150.75,
                    "balance": 1250.55,
                    "baseAmount": 150.75,
                    "baseCurrency": "USD",
                    "taxAmount": 15.07,
                    "taxRate": 10,
                    "taxType": "VAT",
                    "currency": "USD",
                    "counterpartyName": "Staples",
                    "merchantName": "Staples",
                    "date": "2024-05-01T12:00:00.000Z",
                    "category": {
                      "id": "office-supplies",
                      "name": "Office Supplies",
                      "color": "#FF5733",
                      "taxRate": 10,
                      "taxType": "VAT",
                      "slug": "office-supplies"
                    },
                    "status": "completed",
                    "internal": false,
                    "recurring": false,
                    "manual": true,
                    "frequency": null,
                    "isFulfilled": true,
                    "note": "Paid with company credit card",
                    "metadata": {
                      "categoryHint": "office-supplies",
                      "confidenceScore": 0.92
                    },
                    "metadataCompleted": true,
                    "notified": false,
                    "account": {
                      "id": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388",
                      "name": "Company Credit Card",
                      "currency": "USD",
                      "connection": {
                        "id": "0f1a2b3c-4d5e-6f70-8a9b-1c2d3e4f5a6b",
                        "name": "Chase Bank",
                        "logoUrl": "https://cdn.eigenn.io/logos/chase-bank.png"
                      }
                    },
                    "tags": [
                      {
                        "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                        "name": "invoice"
                      }
                    ],
                    "attachments": [
                      {
                        "id": "b7e2f8c1-3d4a-4e2b-9f1a-2c3d4e5f6a7b",
                        "path": [
                          "e1f2d3c4-b5a6-7d8e-9f0a-1b2c3d4e5f6a",
                          "transactions",
                          "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
                          "receipt.pdf"
                        ],
                        "size": 1928716,
                        "type": "application/pdf",
                        "filename": "receipt.pdf"
                      }
                    ]
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "delete": {
        "summary": "Bulk delete transactions",
        "operationId": "deleteTransactions",
        "x-speakeasy-name-override": "deleteMany",
        "description": "Bulk delete up to 100 manually created transactions in a single request. Only transactions created manually can be deleted — bank-synced transactions cannot be removed but can be excluded by updating their status. All targeted transactions must belong to the authenticated team.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Delete multiple manually-created transactions by ID. Max 100 items.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "minItems": 1,
                "maxItems": 100,
                "description": "List of transaction IDs to delete.",
                "example": [
                  "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                  "c3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                ]
              },
              "example": [
                "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f",
                "c3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transactions deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Transaction ID (UUID)."
                      }
                    },
                    "required": [
                      "id"
                    ],
                    "description": "Delete confirmation payload for a single transaction.",
                    "example": {
                      "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                    }
                  },
                  "description": "Delete confirmation payload for multiple transactions.",
                  "example": [
                    {
                      "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                    },
                    {
                      "id": "c3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                    }
                  ]
                },
                "example": [
                  {
                    "id": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                  },
                  {
                    "id": "c3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/transactions/{transactionId}/attachments/{attachmentId}/presigned-url": {
      "post": {
        "summary": "Generate pre-signed URL for transaction attachment",
        "operationId": "getTransactionAttachmentPreSignedUrl",
        "x-speakeasy-name-override": "getAttachmentPreSignedUrl",
        "description": "Generate a time-limited pre-signed URL for downloading a transaction attachment. The URL expires after 60 seconds. Set download=false to get an inline viewing URL instead. Returns 404 if the transaction or attachment is not found, 400 if the file path is unavailable.\n\nRequired scopes: transactions.read",
        "tags": [
          "Transactions"
        ],
        "x-oppulence-required-scopes": [
          "transactions.read"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the transaction",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "Unique identifier of the transaction",
            "in": "path",
            "name": "transactionId"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the attachment to generate a pre-signed URL for",
              "example": "a43dc3a5-6925-4d91-ac9c-4c1a34bdb388"
            },
            "required": true,
            "description": "Unique identifier of the attachment to generate a pre-signed URL for",
            "in": "path",
            "name": "attachmentId"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.",
              "example": true
            },
            "required": false,
            "description": "Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.",
            "in": "query",
            "name": "download"
          }
        ],
        "responses": {
          "200": {
            "description": "Pre-signed URL generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Pre-signed URL for accessing the attachment, valid for 60 seconds",
                      "example": "https://service.eigenn.io/storage/v1/object/sign/vault/transactions/receipt.pdf?token=abc123&expires=1640995200"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO 8601 timestamp when the URL expires",
                      "example": "2024-04-15T10:01:00.000Z"
                    },
                    "fileName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Original filename of the attachment",
                      "example": "receipt.pdf"
                    }
                  },
                  "required": [
                    "url",
                    "expiresAt",
                    "fileName"
                  ],
                  "description": "Pre-signed URL response for transaction attachments.",
                  "example": {
                    "url": "https://service.eigenn.io/storage/v1/object/sign/vault/transactions/receipt.pdf?token=abc123&expires=1640995200",
                    "expiresAt": "2024-05-01T12:01:00.000Z",
                    "fileName": "receipt.pdf"
                  }
                },
                "example": {
                  "url": "https://service.eigenn.io/storage/v1/object/sign/vault/transactions/receipt.pdf?token=abc123&expires=1640995200",
                  "expiresAt": "2024-05-01T12:01:00.000Z",
                  "fileName": "receipt.pdf"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Attachment file path not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Bad Request",
                  "message": "Attachment file path not available"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Transaction or attachment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Not Found",
                  "message": "Transaction attachment not found"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error - Failed to generate pre-signed URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Internal Server Error",
                  "message": "Failed to generate pre-signed URL"
                }
              }
            }
          }
        }
      }
    },
    "/teams": {
      "get": {
        "summary": "List all teams",
        "operationId": "listTeams",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve all teams the authenticated user belongs to. Returns each team's name, settings, and the user's role within it.\n\nRequired scopes: teams.read",
        "tags": [
          "Teams"
        ],
        "x-oppulence-required-scopes": [
          "teams.read"
        ],
        "security": [
          {
            "oauth2": [
              "teams.read"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of teams for the authenticated user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the team",
                            "example": "123e4567-e89b-12d3-a456-426614174000"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the team or organization",
                            "example": "Acme Corporation"
                          },
                          "logoUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri",
                            "description": "URL to the team's logo image",
                            "example": "https://cdn.eigenn.io/logos/acme-corp.png"
                          },
                          "plan": {
                            "type": "string",
                            "enum": [
                              "trial",
                              "starter",
                              "pro"
                            ],
                            "description": "Current subscription plan of the team",
                            "example": "pro"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "logoUrl",
                          "plan"
                        ]
                      },
                      "description": "Array of teams that the user has access to"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{id}": {
      "get": {
        "summary": "Retrieve a team",
        "operationId": "getTeamById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single team by its UUID. Verifies the authenticated user has access before returning. Returns 404 if the team is not found or the user lacks access.\n\nRequired scopes: teams.read",
        "tags": [
          "Teams"
        ],
        "x-oppulence-required-scopes": [
          "teams.read"
        ],
        "security": [
          {
            "oauth2": [
              "teams.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the team",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            "required": true,
            "description": "Unique identifier of the team",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Team details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the team",
                      "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the team or organization",
                      "example": "Acme Corporation"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to the team's logo image",
                      "example": "https://cdn.eigenn.io/logos/acme-corp.png"
                    },
                    "plan": {
                      "type": "string",
                      "enum": [
                        "trial",
                        "starter",
                        "pro"
                      ],
                      "description": "Current subscription plan of the team",
                      "example": "pro"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "logoUrl",
                    "plan"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a team",
        "operationId": "updateTeamById",
        "x-speakeasy-name-override": "update",
        "description": "Update a team’s settings by its UUID. Only workspace owners can perform this operation — returns 403 if the caller is not an owner and 404 if the team is not found or the user lacks membership. If no fields changed, returns the team as-is.\n\nRequired scopes: teams.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Teams"
        ],
        "x-oppulence-required-scopes": [
          "teams.write"
        ],
        "security": [
          {
            "oauth2": [
              "teams.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the team",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            "required": true,
            "description": "Unique identifier of the team",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 32,
                    "description": "Name of the team or organization. Must be between 2 and 32 characters",
                    "example": "Acme Corporation"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Primary contact email address for the team",
                    "example": "team@acme.com"
                  },
                  "logoUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to the team's logo image. Can be hosted in object storage or any valid URL",
                    "example": "https://storage.example.com/avatars/<team-id>/logo.png"
                  },
                  "baseCurrency": {
                    "type": "string",
                    "description": "Base currency for the team in ISO 4217 format (3-letter currency code)",
                    "example": "USD"
                  },
                  "countryCode": {
                    "type": "string",
                    "description": "Country code for the team",
                    "example": "US"
                  },
                  "exportSettings": {
                    "type": "object",
                    "properties": {
                      "csvDelimiter": {
                        "type": "string",
                        "description": "Delimiter to use when generating CSV exports",
                        "example": ","
                      },
                      "includeCSV": {
                        "type": "boolean",
                        "description": "Whether to include a CSV file in exports",
                        "example": true
                      },
                      "includeXLSX": {
                        "type": "boolean",
                        "description": "Whether to include an Excel XLSX file in exports",
                        "example": true
                      },
                      "sendEmail": {
                        "type": "boolean",
                        "description": "Whether to email the export to the accountant",
                        "example": false
                      },
                      "accountantEmail": {
                        "type": "string",
                        "format": "email",
                        "description": "Email address to send export notifications to",
                        "example": "accounting@acme.com"
                      }
                    },
                    "description": "Export preferences for transaction downloads"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the team",
                      "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the team or organization",
                      "example": "Acme Corporation"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to the team's logo image",
                      "example": "https://cdn.eigenn.io/logos/acme-corp.png"
                    },
                    "plan": {
                      "type": "string",
                      "enum": [
                        "trial",
                        "starter",
                        "pro"
                      ],
                      "description": "Current subscription plan of the team",
                      "example": "pro"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "logoUrl",
                    "plan"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams/{id}/members": {
      "get": {
        "summary": "List all team members",
        "operationId": "listTeamMembers",
        "x-speakeasy-name-override": "members",
        "description": "List all members of a team by the team's UUID. Verifies the authenticated user has access to the team before returning — returns 404 if the team is not found or the user lacks membership. Returns each member's name, email, avatar, and role.\n\nRequired scopes: teams.read",
        "tags": [
          "Teams"
        ],
        "x-oppulence-required-scopes": [
          "teams.read"
        ],
        "security": [
          {
            "oauth2": [
              "teams.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the team",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            "required": true,
            "description": "Unique identifier of the team",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Team members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the user",
                            "example": "123e4567-e89b-12d3-a456-426614174000"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "member",
                              "viewer"
                            ],
                            "description": "Role of the team member. 'owner' has full permissions, 'member' can read and write, and 'viewer' is read-only",
                            "example": "owner"
                          },
                          "fullName": {
                            "type": "string",
                            "description": "Full name of the team member",
                            "example": "John Doe"
                          },
                          "avatarUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri",
                            "description": "URL to the team member's avatar image",
                            "example": "https://cdn.eigenn.io/avatars/john-doe.png"
                          }
                        },
                        "required": [
                          "id",
                          "role",
                          "fullName",
                          "avatarUrl"
                        ]
                      },
                      "description": "Array of team members with their roles and information"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/users/me": {
      "get": {
        "summary": "Retrieve the current user",
        "operationId": "getCurrentUser",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve the profile of the currently authenticated user. Returns user details including name, email, avatar URL, and team memberships.\n\nRequired scopes: users.read",
        "tags": [
          "Users"
        ],
        "x-oppulence-required-scopes": [
          "users.read"
        ],
        "security": [
          {
            "oauth2": [
              "users.read"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve the current user for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the user",
                      "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Email address of the user",
                      "example": "jane.doe@acme.com"
                    },
                    "username": {
                      "type": "string",
                      "description": "Username of the user",
                      "example": "janedoe"
                    },
                    "fullName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Full name of the user",
                      "example": "Jane Doe"
                    },
                    "firstName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First name of the user",
                      "example": "Jane"
                    },
                    "lastName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Last name of the user",
                      "example": "Doe"
                    },
                    "profileImageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to the user's profile image",
                      "example": "https://cdn.eigenn.io/profiles/jane-doe.jpg"
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to the user's avatar image",
                      "example": "https://cdn.eigenn.io/avatars/jane-doe.jpg"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "USER",
                        "ADMIN",
                        "SUPERADMIN"
                      ],
                      "description": "Role of the user",
                      "example": "USER"
                    },
                    "locale": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "User's preferred locale for internationalization",
                      "example": "en-US"
                    },
                    "weekStartsOnMonday": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Whether the user's calendar week starts on Monday",
                      "example": true
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "User's timezone identifier in IANA format",
                      "example": "America/New_York"
                    },
                    "hasOnboarded": {
                      "type": "boolean",
                      "description": "Whether the user has completed onboarding",
                      "example": true
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the user was created",
                      "example": "2024-01-15T12:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Timestamp when the user was last updated",
                      "example": "2024-01-15T12:00:00Z"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "username",
                    "role",
                    "hasOnboarded",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update the current user",
        "operationId": "updateCurrentUser",
        "x-speakeasy-name-override": "update",
        "description": "Update the authenticated user's profile fields. Only provided fields are modified. If teamId is provided, verifies the user has access to that team before updating — returns 403 if not.\n\nRequired scopes: users.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Users"
        ],
        "x-oppulence-required-scopes": [
          "users.write"
        ],
        "security": [
          {
            "oauth2": [
              "users.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "teamId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Team/workspace to switch to (must have existing membership)",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  },
                  "fullName": {
                    "type": "string",
                    "description": "Full name of the user",
                    "example": "Jane Doe"
                  },
                  "firstName": {
                    "type": "string",
                    "description": "First name of the user",
                    "example": "Jane"
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Last name of the user",
                    "example": "Doe"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Primary email address for the user's account",
                    "example": "jane.doe@example.com"
                  },
                  "profileImageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to the user's profile image",
                    "example": "https://cdn.eigenn.io/profiles/jane-doe.jpg"
                  },
                  "avatarUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to the user's avatar image",
                    "example": "https://cdn.eigenn.io/avatars/jane-doe.jpg"
                  },
                  "locale": {
                    "type": "string",
                    "description": "User's preferred locale for internationalization",
                    "example": "en-US"
                  },
                  "timeFormat": {
                    "oneOf": [
                      {
                        "type": "number",
                        "enum": [
                          12
                        ]
                      },
                      {
                        "type": "number",
                        "enum": [
                          24
                        ]
                      }
                    ],
                    "description": "Preferred time display format (e.g. 12 or 24 hour)",
                    "example": 12
                  },
                  "dateFormat": {
                    "type": "string",
                    "enum": [
                      "MM/dd/yyyy",
                      "dd/MM/yyyy",
                      "yyyy-MM-dd",
                      "dd.MM.yyyy"
                    ],
                    "description": "Preferred date display format",
                    "example": "MM/dd/yyyy"
                  },
                  "weekStartsOnMonday": {
                    "type": "boolean",
                    "description": "Whether the user's calendar week starts on Monday",
                    "example": true
                  },
                  "timezone": {
                    "type": "string",
                    "description": "User's timezone identifier in IANA format",
                    "example": "America/New_York"
                  },
                  "timezoneAutoSync": {
                    "type": "boolean",
                    "description": "Whether the user prefers automatic timezone syncing",
                    "example": true
                  },
                  "hasOnboarded": {
                    "type": "boolean",
                    "description": "Whether the user has completed onboarding",
                    "example": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the user",
                      "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Email address of the user",
                      "example": "jane.doe@acme.com"
                    },
                    "username": {
                      "type": "string",
                      "description": "Username of the user",
                      "example": "janedoe"
                    },
                    "fullName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Full name of the user",
                      "example": "Jane Doe"
                    },
                    "firstName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First name of the user",
                      "example": "Jane"
                    },
                    "lastName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Last name of the user",
                      "example": "Doe"
                    },
                    "profileImageUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to the user's profile image",
                      "example": "https://cdn.eigenn.io/profiles/jane-doe.jpg"
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to the user's avatar image",
                      "example": "https://cdn.eigenn.io/avatars/jane-doe.jpg"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "USER",
                        "ADMIN",
                        "SUPERADMIN"
                      ],
                      "description": "Role of the user",
                      "example": "USER"
                    },
                    "locale": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "User's preferred locale for internationalization",
                      "example": "en-US"
                    },
                    "weekStartsOnMonday": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Whether the user's calendar week starts on Monday",
                      "example": true
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "User's timezone identifier in IANA format",
                      "example": "America/New_York"
                    },
                    "hasOnboarded": {
                      "type": "boolean",
                      "description": "Whether the user has completed onboarding",
                      "example": true
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the user was created",
                      "example": "2024-01-15T12:00:00Z"
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Timestamp when the user was last updated",
                      "example": "2024-01-15T12:00:00Z"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "username",
                    "role",
                    "hasOnboarded",
                    "createdAt",
                    "updatedAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/customers": {
      "get": {
        "description": "Retrieve a paginated list of customers for the authenticated team. Supports free-text search via the q parameter, which matches against name, email, and other fields.\n\nRequired scopes: customers.read",
        "operationId": "listCustomers",
        "summary": "List all customers",
        "tags": [
          "Customers"
        ],
        "x-speakeasy-name-override": "list",
        "x-oppulence-required-scopes": [
          "customers.read"
        ],
        "security": [
          {
            "oauth2": [
              "customers.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Search query string to filter customers by name, email, or other text fields",
              "example": "acme"
            },
            "required": false,
            "description": "Search query string to filter customers by name, email, or other text fields",
            "in": "query",
            "name": "q"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "prefixItems": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Sorting order as a tuple: [field, direction]. Example: ['name', 'asc'] or ['createdAt', 'desc']",
              "example": [
                "name",
                "asc"
              ]
            },
            "required": false,
            "description": "Sorting order as a tuple: [field, direction]. Example: ['name', 'asc'] or ['createdAt', 'desc']",
            "in": "query",
            "name": "sort"
          },
          {
            "schema": {
              "type": "string",
              "description": "Cursor for pagination, representing the last item from the previous page",
              "example": "eyJpZCI6IjEyMyJ9"
            },
            "required": false,
            "description": "Cursor for pagination, representing the last item from the previous page",
            "in": "query",
            "name": "cursor"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Number of customers to return per page (1-100)",
              "example": 20
            },
            "required": false,
            "description": "Number of customers to return per page (1-100)",
            "in": "query",
            "name": "pageSize"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Filter by tag IDs"
            },
            "required": false,
            "description": "Filter by tag IDs",
            "in": "query",
            "name": "tags"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Filter by country codes"
            },
            "required": false,
            "description": "Filter by country codes",
            "in": "query",
            "name": "country"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "first-time",
                "repeat",
                "recent",
                "unpaid",
                "paid"
              ],
              "description": "Filter by customer tab type",
              "example": "first-time"
            },
            "required": false,
            "description": "Filter by customer tab type",
            "in": "query",
            "name": "tab"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of customers for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page of results, null if no more pages",
                          "example": "eyJ0eXBlIjoib2Zmc2V0Iiwib2Zmc2V0IjoyNX0"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there are results on the previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there are more results on the next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata for the customers response"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the customer",
                            "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the customer or organization",
                            "example": "Acme Corporation"
                          },
                          "email": {
                            "type": "string",
                            "format": "email",
                            "description": "Primary email address of the customer",
                            "example": "contact@acme.com"
                          },
                          "billingEmail": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "email",
                            "description": "Billing email address of the customer",
                            "example": "finance@acme.com"
                          },
                          "phone": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Primary phone number of the customer",
                            "example": "+1-555-123-4567"
                          },
                          "website": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Website URL of the customer",
                            "example": "https://acme.com"
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Date and time when the customer was created in ISO 8601 format",
                            "example": "2024-05-01T12:34:56.789Z"
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country name where the customer is located",
                            "example": "United States"
                          },
                          "addressLine1": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "First line of the customer's address",
                            "example": "123 Main Street"
                          },
                          "addressLine2": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Second line of the customer's address (suite, apartment, etc.)",
                            "example": "Suite 400"
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "City where the customer is located",
                            "example": "San Francisco"
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "State or province where the customer is located",
                            "example": "California"
                          },
                          "zip": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ZIP or postal code of the customer's address",
                            "example": "94105"
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Internal notes about the customer for team reference",
                            "example": "Preferred contact method is email. Large enterprise client."
                          },
                          "vatNumber": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "VAT (Value Added Tax) number of the customer",
                            "example": "US123456789"
                          },
                          "countryCode": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country code in ISO 3166-1 alpha-2 format",
                            "example": "US"
                          },
                          "token": {
                            "type": "string",
                            "description": "Unique token for the customer (used for internal identification)",
                            "example": "cus_abc123xyz789"
                          },
                          "contact": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Primary contact person's name at the customer organization",
                            "example": "John Smith"
                          },
                          "peppolId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                            "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                            "example": "0007:5567890123"
                          },
                          "invoiceCount": {
                            "type": "number",
                            "description": "Total number of invoices created for this customer",
                            "example": 12
                          },
                          "projectCount": {
                            "type": "number",
                            "description": "Total number of projects associated with this customer",
                            "example": 3
                          },
                          "revenue": {
                            "type": "number",
                            "default": 0,
                            "description": "Total revenue from paid invoices",
                            "example": 12500.5
                          },
                          "outstanding": {
                            "type": "number",
                            "default": 0,
                            "description": "Current receivables owed (unpaid + overdue invoice amounts)",
                            "example": 3200
                          },
                          "overdue": {
                            "type": "number",
                            "default": 0,
                            "description": "Past-due slice of outstanding (overdue invoice amounts)",
                            "example": 1500
                          },
                          "openInvoiceCount": {
                            "type": "number",
                            "default": 0,
                            "description": "Number of open invoices (unpaid + overdue)",
                            "example": 2
                          },
                          "lastActivityAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Timestamp of last activity (invoice, note, task, email, activity)",
                            "example": "2024-01-15T10:30:00Z"
                          },
                          "engagementScore": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "minimum": 0,
                            "maximum": 100,
                            "description": "Engagement score based on activity, payments, and interactions (0-100)",
                            "example": 75
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "Unique identifier of the tag",
                                  "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Display name of the tag",
                                  "example": "VIP"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ]
                            },
                            "description": "Array of tags associated with the customer for categorization",
                            "example": [
                              {
                                "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                                "name": "VIP"
                              },
                              {
                                "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                                "name": "Enterprise"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "email",
                          "billingEmail",
                          "phone",
                          "website",
                          "createdAt",
                          "country",
                          "addressLine1",
                          "addressLine2",
                          "city",
                          "state",
                          "zip",
                          "note",
                          "vatNumber",
                          "countryCode",
                          "token",
                          "contact",
                          "peppolId",
                          "invoiceCount",
                          "projectCount",
                          "lastActivityAt",
                          "engagementScore",
                          "tags"
                        ]
                      },
                      "description": "Array of customers matching the query criteria"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ],
                  "description": "Response containing a list of customers and pagination metadata"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Create or upsert a customer for the authenticated team. If a customer with matching identifiers already exists, it is updated. Provide name, email, phone, address, and other contact details. The customer is associated with the creating user for audit purposes.\n\nRequired scopes: customers.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "createCustomer",
        "summary": "Create customer",
        "tags": [
          "Customers"
        ],
        "x-speakeasy-name-override": "create",
        "x-oppulence-required-scopes": [
          "customers.write"
        ],
        "security": [
          {
            "oauth2": [
              "customers.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Unique identifier of the customer. Required for updates, omit for new customers",
                    "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the customer or organization",
                    "example": "Acme Corporation"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Primary email address of the customer",
                    "example": "contact@acme.com"
                  },
                  "billingEmail": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email",
                    "description": "Billing email address of the customer",
                    "example": "finance@acme.com"
                  },
                  "country": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Country name where the customer is located",
                    "example": "United States"
                  },
                  "addressLine1": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "First line of the customer's address",
                    "example": "123 Main Street"
                  },
                  "addressLine2": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Second line of the customer's address (suite, apartment, etc.)",
                    "example": "Suite 400"
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "City where the customer is located",
                    "example": "San Francisco"
                  },
                  "state": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "State or province where the customer is located",
                    "example": "California"
                  },
                  "zip": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "ZIP or postal code of the customer's address",
                    "example": "94105"
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Primary phone number of the customer",
                    "example": "+1-555-123-4567"
                  },
                  "website": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Website URL of the customer",
                    "example": "https://acme.com"
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Internal notes about the customer for team reference",
                    "example": "Preferred contact method is email. Large enterprise client."
                  },
                  "vatNumber": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "VAT (Value Added Tax) number of the customer",
                    "example": "US123456789"
                  },
                  "countryCode": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Country code in ISO 3166-1 alpha-2 format",
                    "example": "US"
                  },
                  "contact": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Primary contact person's name at the customer organization",
                    "example": "John Smith"
                  },
                  "peppolId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                    "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                    "example": "0007:5567890123"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tag",
                          "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                        },
                        "name": {
                          "type": "string",
                          "description": "Display name of the tag",
                          "example": "VIP"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "description": "Array of tags to associate with the customer for categorization",
                    "example": [
                      {
                        "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                        "name": "VIP"
                      },
                      {
                        "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                        "name": "Enterprise"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Customer created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the customer",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the customer or organization",
                      "example": "Acme Corporation"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Primary email address of the customer",
                      "example": "contact@acme.com"
                    },
                    "billingEmail": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "email",
                      "description": "Billing email address of the customer",
                      "example": "finance@acme.com"
                    },
                    "phone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary phone number of the customer",
                      "example": "+1-555-123-4567"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Website URL of the customer",
                      "example": "https://acme.com"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the customer was created in ISO 8601 format",
                      "example": "2024-05-01T12:34:56.789Z"
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country name where the customer is located",
                      "example": "United States"
                    },
                    "addressLine1": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First line of the customer's address",
                      "example": "123 Main Street"
                    },
                    "addressLine2": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Second line of the customer's address (suite, apartment, etc.)",
                      "example": "Suite 400"
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "City where the customer is located",
                      "example": "San Francisco"
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "State or province where the customer is located",
                      "example": "California"
                    },
                    "zip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ZIP or postal code of the customer's address",
                      "example": "94105"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Internal notes about the customer for team reference",
                      "example": "Preferred contact method is email. Large enterprise client."
                    },
                    "vatNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "VAT (Value Added Tax) number of the customer",
                      "example": "US123456789"
                    },
                    "countryCode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country code in ISO 3166-1 alpha-2 format",
                      "example": "US"
                    },
                    "token": {
                      "type": "string",
                      "description": "Unique token for the customer (used for internal identification)",
                      "example": "cus_abc123xyz789"
                    },
                    "contact": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary contact person's name at the customer organization",
                      "example": "John Smith"
                    },
                    "peppolId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                      "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                      "example": "0007:5567890123"
                    },
                    "invoiceCount": {
                      "type": "number",
                      "description": "Total number of invoices created for this customer",
                      "example": 12
                    },
                    "projectCount": {
                      "type": "number",
                      "description": "Total number of projects associated with this customer",
                      "example": 3
                    },
                    "revenue": {
                      "type": "number",
                      "default": 0,
                      "description": "Total revenue from paid invoices",
                      "example": 12500.5
                    },
                    "outstanding": {
                      "type": "number",
                      "default": 0,
                      "description": "Current receivables owed (unpaid + overdue invoice amounts)",
                      "example": 3200
                    },
                    "overdue": {
                      "type": "number",
                      "default": 0,
                      "description": "Past-due slice of outstanding (overdue invoice amounts)",
                      "example": 1500
                    },
                    "openInvoiceCount": {
                      "type": "number",
                      "default": 0,
                      "description": "Number of open invoices (unpaid + overdue)",
                      "example": 2
                    },
                    "lastActivityAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp of last activity (invoice, note, task, email, activity)",
                      "example": "2024-01-15T10:30:00Z"
                    },
                    "engagementScore": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Engagement score based on activity, payments, and interactions (0-100)",
                      "example": 75
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tag",
                            "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                          },
                          "name": {
                            "type": "string",
                            "description": "Display name of the tag",
                            "example": "VIP"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "description": "Array of tags associated with the customer for categorization",
                      "example": [
                        {
                          "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "VIP"
                        },
                        {
                          "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "Enterprise"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "email",
                    "billingEmail",
                    "phone",
                    "website",
                    "createdAt",
                    "country",
                    "addressLine1",
                    "addressLine2",
                    "city",
                    "state",
                    "zip",
                    "note",
                    "vatNumber",
                    "countryCode",
                    "token",
                    "contact",
                    "peppolId",
                    "invoiceCount",
                    "projectCount",
                    "lastActivityAt",
                    "engagementScore",
                    "tags"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/customers/{id}": {
      "get": {
        "description": "Retrieve a single customer by its UUID. Returns the full customer record including contact details, address, and metadata. The customer must belong to the authenticated team.\n\nRequired scopes: customers.read",
        "operationId": "getCustomerById",
        "summary": "Retrieve a customer",
        "tags": [
          "Customers"
        ],
        "x-speakeasy-name-override": "get",
        "x-oppulence-required-scopes": [
          "customers.read"
        ],
        "security": [
          {
            "oauth2": [
              "customers.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Unique identifier of the customer to retrieve",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "Unique identifier of the customer to retrieve",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a customer by ID for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the customer",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the customer or organization",
                      "example": "Acme Corporation"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Primary email address of the customer",
                      "example": "contact@acme.com"
                    },
                    "billingEmail": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "email",
                      "description": "Billing email address of the customer",
                      "example": "finance@acme.com"
                    },
                    "phone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary phone number of the customer",
                      "example": "+1-555-123-4567"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Website URL of the customer",
                      "example": "https://acme.com"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the customer was created in ISO 8601 format",
                      "example": "2024-05-01T12:34:56.789Z"
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country name where the customer is located",
                      "example": "United States"
                    },
                    "addressLine1": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First line of the customer's address",
                      "example": "123 Main Street"
                    },
                    "addressLine2": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Second line of the customer's address (suite, apartment, etc.)",
                      "example": "Suite 400"
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "City where the customer is located",
                      "example": "San Francisco"
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "State or province where the customer is located",
                      "example": "California"
                    },
                    "zip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ZIP or postal code of the customer's address",
                      "example": "94105"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Internal notes about the customer for team reference",
                      "example": "Preferred contact method is email. Large enterprise client."
                    },
                    "vatNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "VAT (Value Added Tax) number of the customer",
                      "example": "US123456789"
                    },
                    "countryCode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country code in ISO 3166-1 alpha-2 format",
                      "example": "US"
                    },
                    "token": {
                      "type": "string",
                      "description": "Unique token for the customer (used for internal identification)",
                      "example": "cus_abc123xyz789"
                    },
                    "contact": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary contact person's name at the customer organization",
                      "example": "John Smith"
                    },
                    "peppolId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                      "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                      "example": "0007:5567890123"
                    },
                    "invoiceCount": {
                      "type": "number",
                      "description": "Total number of invoices created for this customer",
                      "example": 12
                    },
                    "projectCount": {
                      "type": "number",
                      "description": "Total number of projects associated with this customer",
                      "example": 3
                    },
                    "revenue": {
                      "type": "number",
                      "default": 0,
                      "description": "Total revenue from paid invoices",
                      "example": 12500.5
                    },
                    "outstanding": {
                      "type": "number",
                      "default": 0,
                      "description": "Current receivables owed (unpaid + overdue invoice amounts)",
                      "example": 3200
                    },
                    "overdue": {
                      "type": "number",
                      "default": 0,
                      "description": "Past-due slice of outstanding (overdue invoice amounts)",
                      "example": 1500
                    },
                    "openInvoiceCount": {
                      "type": "number",
                      "default": 0,
                      "description": "Number of open invoices (unpaid + overdue)",
                      "example": 2
                    },
                    "lastActivityAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp of last activity (invoice, note, task, email, activity)",
                      "example": "2024-01-15T10:30:00Z"
                    },
                    "engagementScore": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Engagement score based on activity, payments, and interactions (0-100)",
                      "example": 75
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tag",
                            "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                          },
                          "name": {
                            "type": "string",
                            "description": "Display name of the tag",
                            "example": "VIP"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "description": "Array of tags associated with the customer for categorization",
                      "example": [
                        {
                          "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "VIP"
                        },
                        {
                          "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "Enterprise"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "email",
                    "billingEmail",
                    "phone",
                    "website",
                    "createdAt",
                    "country",
                    "addressLine1",
                    "addressLine2",
                    "city",
                    "state",
                    "zip",
                    "note",
                    "vatNumber",
                    "countryCode",
                    "token",
                    "contact",
                    "peppolId",
                    "invoiceCount",
                    "projectCount",
                    "lastActivityAt",
                    "engagementScore",
                    "tags"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Update a customer's fields by its UUID. Uses an upsert pattern — only provided fields are modified. The customer must belong to the authenticated team.\n\nRequired scopes: customers.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "updateCustomer",
        "summary": "Update a customer",
        "tags": [
          "Customers"
        ],
        "x-speakeasy-name-override": "update",
        "x-oppulence-required-scopes": [
          "customers.write"
        ],
        "security": [
          {
            "oauth2": [
              "customers.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Unique identifier of the customer to retrieve",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "Unique identifier of the customer to retrieve",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Unique identifier of the customer. Required for updates, omit for new customers",
                    "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the customer or organization",
                    "example": "Acme Corporation"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Primary email address of the customer",
                    "example": "contact@acme.com"
                  },
                  "billingEmail": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email",
                    "description": "Billing email address of the customer",
                    "example": "finance@acme.com"
                  },
                  "country": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Country name where the customer is located",
                    "example": "United States"
                  },
                  "addressLine1": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "First line of the customer's address",
                    "example": "123 Main Street"
                  },
                  "addressLine2": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Second line of the customer's address (suite, apartment, etc.)",
                    "example": "Suite 400"
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "City where the customer is located",
                    "example": "San Francisco"
                  },
                  "state": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "State or province where the customer is located",
                    "example": "California"
                  },
                  "zip": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "ZIP or postal code of the customer's address",
                    "example": "94105"
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Primary phone number of the customer",
                    "example": "+1-555-123-4567"
                  },
                  "website": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Website URL of the customer",
                    "example": "https://acme.com"
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Internal notes about the customer for team reference",
                    "example": "Preferred contact method is email. Large enterprise client."
                  },
                  "vatNumber": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "VAT (Value Added Tax) number of the customer",
                    "example": "US123456789"
                  },
                  "countryCode": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Country code in ISO 3166-1 alpha-2 format",
                    "example": "US"
                  },
                  "contact": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Primary contact person's name at the customer organization",
                    "example": "John Smith"
                  },
                  "peppolId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                    "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                    "example": "0007:5567890123"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tag",
                          "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                        },
                        "name": {
                          "type": "string",
                          "description": "Display name of the tag",
                          "example": "VIP"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ]
                    },
                    "description": "Array of tags to associate with the customer for categorization",
                    "example": [
                      {
                        "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                        "name": "VIP"
                      },
                      {
                        "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                        "name": "Enterprise"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Customer updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the customer",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the customer or organization",
                      "example": "Acme Corporation"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Primary email address of the customer",
                      "example": "contact@acme.com"
                    },
                    "billingEmail": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "email",
                      "description": "Billing email address of the customer",
                      "example": "finance@acme.com"
                    },
                    "phone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary phone number of the customer",
                      "example": "+1-555-123-4567"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Website URL of the customer",
                      "example": "https://acme.com"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the customer was created in ISO 8601 format",
                      "example": "2024-05-01T12:34:56.789Z"
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country name where the customer is located",
                      "example": "United States"
                    },
                    "addressLine1": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First line of the customer's address",
                      "example": "123 Main Street"
                    },
                    "addressLine2": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Second line of the customer's address (suite, apartment, etc.)",
                      "example": "Suite 400"
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "City where the customer is located",
                      "example": "San Francisco"
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "State or province where the customer is located",
                      "example": "California"
                    },
                    "zip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ZIP or postal code of the customer's address",
                      "example": "94105"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Internal notes about the customer for team reference",
                      "example": "Preferred contact method is email. Large enterprise client."
                    },
                    "vatNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "VAT (Value Added Tax) number of the customer",
                      "example": "US123456789"
                    },
                    "countryCode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country code in ISO 3166-1 alpha-2 format",
                      "example": "US"
                    },
                    "token": {
                      "type": "string",
                      "description": "Unique token for the customer (used for internal identification)",
                      "example": "cus_abc123xyz789"
                    },
                    "contact": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary contact person's name at the customer organization",
                      "example": "John Smith"
                    },
                    "peppolId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                      "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                      "example": "0007:5567890123"
                    },
                    "invoiceCount": {
                      "type": "number",
                      "description": "Total number of invoices created for this customer",
                      "example": 12
                    },
                    "projectCount": {
                      "type": "number",
                      "description": "Total number of projects associated with this customer",
                      "example": 3
                    },
                    "revenue": {
                      "type": "number",
                      "default": 0,
                      "description": "Total revenue from paid invoices",
                      "example": 12500.5
                    },
                    "outstanding": {
                      "type": "number",
                      "default": 0,
                      "description": "Current receivables owed (unpaid + overdue invoice amounts)",
                      "example": 3200
                    },
                    "overdue": {
                      "type": "number",
                      "default": 0,
                      "description": "Past-due slice of outstanding (overdue invoice amounts)",
                      "example": 1500
                    },
                    "openInvoiceCount": {
                      "type": "number",
                      "default": 0,
                      "description": "Number of open invoices (unpaid + overdue)",
                      "example": 2
                    },
                    "lastActivityAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp of last activity (invoice, note, task, email, activity)",
                      "example": "2024-01-15T10:30:00Z"
                    },
                    "engagementScore": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Engagement score based on activity, payments, and interactions (0-100)",
                      "example": 75
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tag",
                            "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                          },
                          "name": {
                            "type": "string",
                            "description": "Display name of the tag",
                            "example": "VIP"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "description": "Array of tags associated with the customer for categorization",
                      "example": [
                        {
                          "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "VIP"
                        },
                        {
                          "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "Enterprise"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "email",
                    "billingEmail",
                    "phone",
                    "website",
                    "createdAt",
                    "country",
                    "addressLine1",
                    "addressLine2",
                    "city",
                    "state",
                    "zip",
                    "note",
                    "vatNumber",
                    "countryCode",
                    "token",
                    "contact",
                    "peppolId",
                    "invoiceCount",
                    "projectCount",
                    "lastActivityAt",
                    "engagementScore",
                    "tags"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Delete a customer by its UUID. Returns the deleted customer's details on success. The customer must belong to the authenticated team. Associated invoices are not automatically deleted.\n\nRequired scopes: customers.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "deleteCustomer",
        "summary": "Delete a customer",
        "tags": [
          "Customers"
        ],
        "x-speakeasy-name-override": "delete",
        "x-oppulence-required-scopes": [
          "customers.write"
        ],
        "security": [
          {
            "oauth2": [
              "customers.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Unique identifier of the customer to retrieve",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "Unique identifier of the customer to retrieve",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Customer deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the customer",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the customer or organization",
                      "example": "Acme Corporation"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Primary email address of the customer",
                      "example": "contact@acme.com"
                    },
                    "billingEmail": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "email",
                      "description": "Billing email address of the customer",
                      "example": "finance@acme.com"
                    },
                    "phone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary phone number of the customer",
                      "example": "+1-555-123-4567"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Website URL of the customer",
                      "example": "https://acme.com"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the customer was created in ISO 8601 format",
                      "example": "2024-05-01T12:34:56.789Z"
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country name where the customer is located",
                      "example": "United States"
                    },
                    "addressLine1": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "First line of the customer's address",
                      "example": "123 Main Street"
                    },
                    "addressLine2": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Second line of the customer's address (suite, apartment, etc.)",
                      "example": "Suite 400"
                    },
                    "city": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "City where the customer is located",
                      "example": "San Francisco"
                    },
                    "state": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "State or province where the customer is located",
                      "example": "California"
                    },
                    "zip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ZIP or postal code of the customer's address",
                      "example": "94105"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Internal notes about the customer for team reference",
                      "example": "Preferred contact method is email. Large enterprise client."
                    },
                    "vatNumber": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "VAT (Value Added Tax) number of the customer",
                      "example": "US123456789"
                    },
                    "countryCode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country code in ISO 3166-1 alpha-2 format",
                      "example": "US"
                    },
                    "token": {
                      "type": "string",
                      "description": "Unique token for the customer (used for internal identification)",
                      "example": "cus_abc123xyz789"
                    },
                    "contact": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Primary contact person's name at the customer organization",
                      "example": "John Smith"
                    },
                    "peppolId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^\\d{4}:[A-Za-z0-9\\-._~]+$",
                      "description": "Peppol participant ID for e-invoicing (format: scheme:identifier, e.g., 0007:5567890123)",
                      "example": "0007:5567890123"
                    },
                    "invoiceCount": {
                      "type": "number",
                      "description": "Total number of invoices created for this customer",
                      "example": 12
                    },
                    "projectCount": {
                      "type": "number",
                      "description": "Total number of projects associated with this customer",
                      "example": 3
                    },
                    "revenue": {
                      "type": "number",
                      "default": 0,
                      "description": "Total revenue from paid invoices",
                      "example": 12500.5
                    },
                    "outstanding": {
                      "type": "number",
                      "default": 0,
                      "description": "Current receivables owed (unpaid + overdue invoice amounts)",
                      "example": 3200
                    },
                    "overdue": {
                      "type": "number",
                      "default": 0,
                      "description": "Past-due slice of outstanding (overdue invoice amounts)",
                      "example": 1500
                    },
                    "openInvoiceCount": {
                      "type": "number",
                      "default": 0,
                      "description": "Number of open invoices (unpaid + overdue)",
                      "example": 2
                    },
                    "lastActivityAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp of last activity (invoice, note, task, email, activity)",
                      "example": "2024-01-15T10:30:00Z"
                    },
                    "engagementScore": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "minimum": 0,
                      "maximum": 100,
                      "description": "Engagement score based on activity, payments, and interactions (0-100)",
                      "example": 75
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tag",
                            "example": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                          },
                          "name": {
                            "type": "string",
                            "description": "Display name of the tag",
                            "example": "VIP"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "description": "Array of tags associated with the customer for categorization",
                      "example": [
                        {
                          "id": "e7a9c1a2-4c2a-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "VIP"
                        },
                        {
                          "id": "f1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4",
                          "name": "Enterprise"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "email",
                    "billingEmail",
                    "phone",
                    "website",
                    "createdAt",
                    "country",
                    "addressLine1",
                    "addressLine2",
                    "city",
                    "state",
                    "zip",
                    "note",
                    "vatNumber",
                    "countryCode",
                    "token",
                    "contact",
                    "peppolId",
                    "invoiceCount",
                    "projectCount",
                    "lastActivityAt",
                    "engagementScore",
                    "tags"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/bank-accounts": {
      "get": {
        "summary": "List all bank accounts",
        "operationId": "listBankAccounts",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a list of bank accounts for the authenticated team. Returns all bank accounts scoped to the team, including account details, balances, and connection status.\n\nRequired scopes: bank-accounts.read",
        "tags": [
          "Bank Accounts"
        ],
        "x-oppulence-required-scopes": [
          "bank-accounts.read"
        ],
        "security": [
          {
            "oauth2": [
              "bank-accounts.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "boolean",
              "description": "Whether the bank account is enabled."
            },
            "required": false,
            "description": "Whether the bank account is enabled.",
            "in": "query",
            "name": "enabled"
          },
          {
            "schema": {
              "type": "boolean",
              "description": "Whether the bank account is a manual account."
            },
            "required": false,
            "description": "Whether the bank account is a manual account.",
            "in": "query",
            "name": "manual"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of bank accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier for the bank account.",
                            "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of the bank account.",
                            "example": "Checking Account"
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Currency code of the bank account (e.g., USD, EUR).",
                            "example": "USD"
                          },
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Type of the bank account (e.g., depository, credit).",
                            "example": "depository"
                          },
                          "enabled": {
                            "type": "boolean",
                            "description": "Whether the bank account is enabled.",
                            "example": true
                          },
                          "balance": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Current balance of the bank account.",
                            "example": 1500.75
                          },
                          "manual": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Whether the bank account is a manual account.",
                            "example": false
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "currency",
                          "type",
                          "enabled",
                          "balance",
                          "manual"
                        ],
                        "description": "A single bank account object response.",
                        "example": {
                          "id": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc",
                          "name": "Checking Account",
                          "currency": "USD",
                          "type": "depository",
                          "enabled": true,
                          "balance": 1500.75,
                          "manual": false
                        }
                      },
                      "description": "Array of bank account objects."
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "description": "Response containing a list of bank accounts."
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a bank account",
        "operationId": "createBankAccount",
        "x-speakeasy-name-override": "create",
        "description": "Create a new bank account record for the authenticated team. Provide account details such as name, institution, account number, and currency. The account is associated with the creating user for audit purposes.\n\nRequired scopes: bank-accounts.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Bank Accounts"
        ],
        "x-oppulence-required-scopes": [
          "bank-accounts.write"
        ],
        "security": [
          {
            "oauth2": [
              "bank-accounts.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the bank account.",
                    "example": "Checking Account"
                  },
                  "currency": {
                    "type": "string",
                    "description": "The currency code for the bank account (ISO 4217).",
                    "example": "USD"
                  },
                  "manual": {
                    "type": "boolean",
                    "description": "Whether the bank account is a manual account.",
                    "example": false
                  }
                },
                "required": [
                  "name"
                ],
                "description": "Schema for creating a new bank account.",
                "example": {
                  "name": "Checking Account",
                  "currency": "USD",
                  "manual": false
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bank account created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the bank account.",
                      "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the bank account.",
                      "example": "Checking Account"
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code of the bank account (e.g., USD, EUR).",
                      "example": "USD"
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Type of the bank account (e.g., depository, credit).",
                      "example": "depository"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "Whether the bank account is enabled.",
                      "example": true
                    },
                    "balance": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Current balance of the bank account.",
                      "example": 1500.75
                    },
                    "manual": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Whether the bank account is a manual account.",
                      "example": false
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "currency",
                    "type",
                    "enabled",
                    "balance",
                    "manual"
                  ],
                  "description": "A single bank account object response.",
                  "example": {
                    "id": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc",
                    "name": "Checking Account",
                    "currency": "USD",
                    "type": "depository",
                    "enabled": true,
                    "balance": 1500.75,
                    "manual": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/bank-accounts/{id}": {
      "get": {
        "summary": "Retrieve a bank account",
        "operationId": "getBankAccountById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single bank account by its UUID. The account must belong to the authenticated team. Returns full account details including institution info, account type, and current balance.\n\nRequired scopes: bank-accounts.read",
        "tags": [
          "Bank Accounts"
        ],
        "x-oppulence-required-scopes": [
          "bank-accounts.read"
        ],
        "security": [
          {
            "oauth2": [
              "bank-accounts.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The unique identifier of the bank account.",
              "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
            },
            "required": true,
            "description": "The unique identifier of the bank account.",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bank account details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the bank account.",
                      "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the bank account.",
                      "example": "Checking Account"
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code of the bank account (e.g., USD, EUR).",
                      "example": "USD"
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Type of the bank account (e.g., depository, credit).",
                      "example": "depository"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "Whether the bank account is enabled.",
                      "example": true
                    },
                    "balance": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Current balance of the bank account.",
                      "example": 1500.75
                    },
                    "manual": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Whether the bank account is a manual account.",
                      "example": false
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "currency",
                    "type",
                    "enabled",
                    "balance",
                    "manual"
                  ],
                  "description": "A single bank account object response.",
                  "example": {
                    "id": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc",
                    "name": "Checking Account",
                    "currency": "USD",
                    "type": "depository",
                    "enabled": true,
                    "balance": 1500.75,
                    "manual": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a bank account",
        "operationId": "updateBankAccount",
        "x-speakeasy-name-override": "update",
        "description": "Update a bank account's details by its UUID. Only provided fields are modified. The account must belong to the authenticated team.\n\nRequired scopes: bank-accounts.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Bank Accounts"
        ],
        "x-oppulence-required-scopes": [
          "bank-accounts.write"
        ],
        "security": [
          {
            "oauth2": [
              "bank-accounts.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The unique identifier of the bank account.",
              "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
            },
            "required": true,
            "description": "The unique identifier of the bank account.",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the bank account.",
                    "example": "Checking Account"
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the bank account is enabled.",
                    "example": true
                  },
                  "balance": {
                    "type": "number",
                    "description": "Current balance of the bank account.",
                    "example": 1500.75
                  },
                  "currency": {
                    "type": "string",
                    "description": "The currency code for the bank account (ISO 4217).",
                    "example": "USD"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "depository",
                      "credit",
                      "other_asset",
                      "loan",
                      "other_liability"
                    ],
                    "description": "Type of the bank account.",
                    "example": "depository"
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The unique identifier of the bank account.",
                    "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
                  }
                },
                "description": "Schema for updating a bank account.",
                "example": {
                  "id": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc",
                  "name": "Checking Account",
                  "enabled": true,
                  "balance": 1500.75,
                  "type": "depository"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bank account updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the bank account.",
                      "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the bank account.",
                      "example": "Checking Account"
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code of the bank account (e.g., USD, EUR).",
                      "example": "USD"
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Type of the bank account (e.g., depository, credit).",
                      "example": "depository"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "Whether the bank account is enabled.",
                      "example": true
                    },
                    "balance": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Current balance of the bank account.",
                      "example": 1500.75
                    },
                    "manual": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Whether the bank account is a manual account.",
                      "example": false
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "currency",
                    "type",
                    "enabled",
                    "balance",
                    "manual"
                  ],
                  "description": "A single bank account object response.",
                  "example": {
                    "id": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc",
                    "name": "Checking Account",
                    "currency": "USD",
                    "type": "depository",
                    "enabled": true,
                    "balance": 1500.75,
                    "manual": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a bank account",
        "operationId": "deleteBankAccount",
        "x-speakeasy-name-override": "delete",
        "description": "Delete a bank account by its UUID. The account must belong to the authenticated team. Returns the deleted account's details on success.\n\nRequired scopes: bank-accounts.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Bank Accounts"
        ],
        "x-oppulence-required-scopes": [
          "bank-accounts.write"
        ],
        "security": [
          {
            "oauth2": [
              "bank-accounts.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The unique identifier of the bank account.",
              "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
            },
            "required": true,
            "description": "The unique identifier of the bank account.",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Bank account deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the bank account.",
                      "example": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the bank account.",
                      "example": "Checking Account"
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code of the bank account (e.g., USD, EUR).",
                      "example": "USD"
                    },
                    "type": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Type of the bank account (e.g., depository, credit).",
                      "example": "depository"
                    },
                    "enabled": {
                      "type": "boolean",
                      "description": "Whether the bank account is enabled.",
                      "example": true
                    },
                    "balance": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Current balance of the bank account.",
                      "example": 1500.75
                    },
                    "manual": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Whether the bank account is a manual account.",
                      "example": false
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "currency",
                    "type",
                    "enabled",
                    "balance",
                    "manual"
                  ],
                  "description": "A single bank account object response.",
                  "example": {
                    "id": "b7e6c2a0-1f2d-4c3b-9a8e-123456789abc",
                    "name": "Checking Account",
                    "currency": "USD",
                    "type": "depository",
                    "enabled": true,
                    "balance": 1500.75,
                    "manual": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tags": {
      "get": {
        "summary": "List all tags",
        "operationId": "listTags",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve all tags for the authenticated team. Tags are used to categorize and label transactions, invoices, and other entities. Returns the full list (not paginated).\n\nRequired scopes: tags.read",
        "tags": [
          "Tags"
        ],
        "x-oppulence-required-scopes": [
          "tags.read"
        ],
        "security": [
          {
            "oauth2": [
              "tags.read"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of tags for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a new tag",
        "operationId": "createTag",
        "x-speakeasy-name-override": "create",
        "description": "Create a new tag for the authenticated team. Provide a name for the tag. Tags can be applied to transactions and other entities for categorization.\n\nRequired scopes: tags.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tags"
        ],
        "x-oppulence-required-scopes": [
          "tags.write"
        ],
        "security": [
          {
            "oauth2": [
              "tags.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTag"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Tag created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/tags/{id}": {
      "get": {
        "summary": "Retrieve a tag",
        "operationId": "getTagById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single tag by its UUID. Returns the tag's name and associated metadata. The tag must belong to the authenticated team.\n\nRequired scopes: tags.read",
        "tags": [
          "Tags"
        ],
        "x-oppulence-required-scopes": [
          "tags.read"
        ],
        "security": [
          {
            "oauth2": [
              "tags.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The UUID of the tag.",
              "example": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
            },
            "required": true,
            "description": "The UUID of the tag.",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a tag by ID for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a tag",
        "operationId": "updateTag",
        "x-speakeasy-name-override": "update",
        "description": "Update a tag's name by its UUID. The tag must belong to the authenticated team. Only the name field can be modified. Returns the updated tag.\n\nRequired scopes: tags.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tags"
        ],
        "x-oppulence-required-scopes": [
          "tags.write"
        ],
        "security": [
          {
            "oauth2": [
              "tags.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The ID of the tag to update.",
              "example": "b3b7c8e2-1f2a-4c3d-9e4f-5a6b7c8d9e0f"
            },
            "required": true,
            "description": "The ID of the tag to update.",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the tag.",
                    "example": "Important"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tag updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a tag",
        "operationId": "deleteTag",
        "x-speakeasy-name-override": "delete",
        "description": "Permanently delete a tag by its UUID. The tag must belong to the authenticated team. Removing a tag does not affect the entities it was previously applied to. Returns 204 on success.\n\nRequired scopes: tags.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tags"
        ],
        "x-oppulence-required-scopes": [
          "tags.write"
        ],
        "security": [
          {
            "oauth2": [
              "tags.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The UUID of the tag to delete.",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "The UUID of the tag to delete.",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "204": {
            "description": "Tag deleted"
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents": {
      "get": {
        "summary": "List all documents",
        "operationId": "listDocuments",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a paginated list of documents for the authenticated team. Supports cursor-based pagination and optional filters. Documents represent uploaded files stored in the team's vault.\n\nRequired scopes: documents.read",
        "tags": [
          "Documents"
        ],
        "x-oppulence-required-scopes": [
          "documents.read"
        ],
        "security": [
          {
            "oauth2": [
              "documents.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "A cursor for pagination. Pass the value returned from the previous response to get the next page.",
              "example": "20"
            },
            "required": false,
            "description": "A cursor for pagination. Pass the value returned from the previous response to get the next page.",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Number of documents to return per page.",
              "example": 20
            },
            "required": false,
            "description": "Number of documents to return per page.",
            "name": "pageSize",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Filter documents by parent document ID.",
              "example": "doc_parent123"
            },
            "required": false,
            "description": "Filter documents by parent document ID.",
            "name": "parentDocumentId",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Search query string to filter documents by text.",
              "example": "invoice"
            },
            "required": false,
            "description": "Search query string to filter documents by text.",
            "name": "q",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "prefixItems": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Sorting order as a tuple: [field, direction]. Example: ['name', 'asc']."
            },
            "required": false,
            "description": "Sorting order as a tuple: [field, direction]. Example: ['name', 'asc'].",
            "in": "query",
            "name": "sort"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of tag IDs to filter documents by tags.",
              "example": [
                "tag1",
                "tag2"
              ]
            },
            "required": false,
            "description": "Array of tag IDs to filter documents by tags.",
            "name": "tags",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of documents for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page of results, null if no more pages",
                          "example": "eyJ0eXBlIjoib2Zmc2V0Iiwib2Zmc2V0IjoyNX0"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there are results on the previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there are more results on the next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata for the documents list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier for the document.",
                            "example": "doc_1234567890abcdef"
                          },
                          "date": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Date associated with the document (ISO 8601).",
                            "example": "2024-04-30"
                          },
                          "metadata": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "colors": {
                                "type": "object",
                                "properties": {
                                  "background": {
                                    "type": "string",
                                    "description": "Background color used when representing the folder.",
                                    "example": "#EEF2FF"
                                  },
                                  "border": {
                                    "type": "string",
                                    "description": "Border color accent for the folder.",
                                    "example": "#C7D2FE"
                                  },
                                  "foreground": {
                                    "type": "string",
                                    "description": "Foreground/text color for the folder.",
                                    "example": "#3730A3"
                                  }
                                },
                                "description": "Optional color palette applied when rendering folder cards."
                              },
                              "folder": {
                                "type": "string",
                                "description": "Display name for the folder.",
                                "example": "Contracts"
                              },
                              "isFolder": {
                                "type": "boolean",
                                "description": "Indicates whether the record represents a folder.",
                                "example": true
                              },
                              "mimetype": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "MIME type of the document.",
                                "example": "application/pdf"
                              },
                              "pathTokens": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "Storage tokens representing the folder path. Used when creating nested uploads.",
                                "example": [
                                  "team_123",
                                  "contracts"
                                ]
                              },
                              "placeholderPath": {
                                "type": "string",
                                "description": "Storage path for the hidden placeholder object that keeps the folder prefix.",
                                "example": "team_123/contracts/.folderPlaceholder"
                              },
                              "size": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Size of the document in bytes.",
                                "example": 204800
                              }
                            },
                            "additionalProperties": {},
                            "description": "Metadata about the document or folder."
                          },
                          "pathTokens": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Array of path tokens representing the document's location.",
                            "example": [
                              "invoices",
                              "2024",
                              "april",
                              "invoice-123.pdf"
                            ]
                          },
                          "processingStatus": {
                            "type": "string",
                            "description": "Processing status of the document.",
                            "example": "processed"
                          },
                          "summary": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Summary or extracted content from the document.",
                            "example": "Invoice for April 2024, total $1,200.00"
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Title of the document.",
                            "example": "Invoice April 2024"
                          }
                        },
                        "required": [
                          "id",
                          "date",
                          "metadata",
                          "pathTokens",
                          "processingStatus",
                          "summary",
                          "title"
                        ],
                        "description": "A single document object response.",
                        "example": {
                          "id": "doc_1234567890abcdef",
                          "date": "2024-04-30",
                          "metadata": {
                            "mimetype": "application/pdf",
                            "size": 204800
                          },
                          "pathTokens": [
                            "invoices",
                            "2024",
                            "april",
                            "invoice-123.pdf"
                          ],
                          "processingStatus": "processed",
                          "summary": "Invoice for April 2024, total $1,200.00",
                          "title": "Invoice April 2024"
                        }
                      },
                      "description": "Array of document objects"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ],
                  "description": "Response containing a list of documents and pagination metadata"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{id}": {
      "get": {
        "summary": "Retrieve a document",
        "operationId": "getDocumentById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single document by its UUID. Returns document metadata including name, file path, size, and content type. The document must belong to the authenticated team.\n\nRequired scopes: documents.read",
        "tags": [
          "Documents"
        ],
        "x-oppulence-required-scopes": [
          "documents.read"
        ],
        "security": [
          {
            "oauth2": [
              "documents.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a document by its unique identifier",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the document.",
                      "example": "doc_1234567890abcdef"
                    },
                    "date": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Date associated with the document (ISO 8601).",
                      "example": "2024-04-30"
                    },
                    "metadata": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "colors": {
                          "type": "object",
                          "properties": {
                            "background": {
                              "type": "string",
                              "description": "Background color used when representing the folder.",
                              "example": "#EEF2FF"
                            },
                            "border": {
                              "type": "string",
                              "description": "Border color accent for the folder.",
                              "example": "#C7D2FE"
                            },
                            "foreground": {
                              "type": "string",
                              "description": "Foreground/text color for the folder.",
                              "example": "#3730A3"
                            }
                          },
                          "description": "Optional color palette applied when rendering folder cards."
                        },
                        "folder": {
                          "type": "string",
                          "description": "Display name for the folder.",
                          "example": "Contracts"
                        },
                        "isFolder": {
                          "type": "boolean",
                          "description": "Indicates whether the record represents a folder.",
                          "example": true
                        },
                        "mimetype": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "MIME type of the document.",
                          "example": "application/pdf"
                        },
                        "pathTokens": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Storage tokens representing the folder path. Used when creating nested uploads.",
                          "example": [
                            "team_123",
                            "contracts"
                          ]
                        },
                        "placeholderPath": {
                          "type": "string",
                          "description": "Storage path for the hidden placeholder object that keeps the folder prefix.",
                          "example": "team_123/contracts/.folderPlaceholder"
                        },
                        "size": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Size of the document in bytes.",
                          "example": 204800
                        }
                      },
                      "additionalProperties": {},
                      "description": "Metadata about the document or folder."
                    },
                    "pathTokens": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Array of path tokens representing the document's location.",
                      "example": [
                        "invoices",
                        "2024",
                        "april",
                        "invoice-123.pdf"
                      ]
                    },
                    "processingStatus": {
                      "type": "string",
                      "description": "Processing status of the document.",
                      "example": "processed"
                    },
                    "summary": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Summary or extracted content from the document.",
                      "example": "Invoice for April 2024, total $1,200.00"
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Title of the document.",
                      "example": "Invoice April 2024"
                    }
                  },
                  "required": [
                    "id",
                    "date",
                    "metadata",
                    "pathTokens",
                    "processingStatus",
                    "summary",
                    "title"
                  ],
                  "description": "A single document object response.",
                  "example": {
                    "id": "doc_1234567890abcdef",
                    "date": "2024-04-30",
                    "metadata": {
                      "mimetype": "application/pdf",
                      "size": 204800
                    },
                    "pathTokens": [
                      "invoices",
                      "2024",
                      "april",
                      "invoice-123.pdf"
                    ],
                    "processingStatus": "processed",
                    "summary": "Invoice for April 2024, total $1,200.00",
                    "title": "Invoice April 2024"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a document",
        "operationId": "deleteDocument",
        "x-speakeasy-name-override": "delete",
        "description": "Permanently delete a document by its UUID. The document must belong to the authenticated team. This removes the document record but the underlying file in storage may be retained per the team's retention policy.\n\nRequired scopes: documents.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Documents"
        ],
        "x-oppulence-required-scopes": [
          "documents.write"
        ],
        "security": [
          {
            "oauth2": [
              "documents.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Unique identifier of the document",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            },
            "required": true,
            "description": "Unique identifier of the document",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Document deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the deleted document",
                      "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/documents/{id}/presigned-url": {
      "post": {
        "summary": "Generate pre-signed URL for document",
        "operationId": "getDocumentPreSignedUrl",
        "x-speakeasy-name-override": "getPreSignedUrl",
        "description": "Generate a pre-signed URL for accessing a document. The URL is valid for 60 seconds and allows secure temporary access to the document file.\n\nRequired scopes: documents.read",
        "tags": [
          "Documents"
        ],
        "x-oppulence-required-scopes": [
          "documents.read"
        ],
        "security": [
          {
            "oauth2": [
              "documents.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the document to generate a pre-signed URL for",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "Unique identifier of the document to generate a pre-signed URL for",
            "in": "path",
            "name": "id"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.",
              "example": true
            },
            "required": false,
            "description": "Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.",
            "in": "query",
            "name": "download"
          }
        ],
        "responses": {
          "200": {
            "description": "Pre-signed URL generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO 8601 timestamp when the URL expires",
                      "example": "2024-04-15T10:01:00.000Z"
                    },
                    "fileName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Original filename of the document",
                      "example": "invoice-april-2024.pdf"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Pre-signed URL for accessing the document, valid for 60 seconds",
                      "example": "https://service.eigenn.io/storage/v1/object/sign/vault/documents/2024/invoice.pdf?token=abc123&expires=1640995200"
                    }
                  },
                  "required": [
                    "expiresAt",
                    "fileName",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Document file path not available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Document not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error - Failed to generate pre-signed URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/inbox": {
      "get": {
        "summary": "List all inbox items",
        "operationId": "listInboxItems",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a paginated list of inbox items for the authenticated team. Inbox items represent incoming documents (receipts, invoices, statements) awaiting review. Supports cursor-based pagination, ordering, and status filters.\n\nRequired scopes: inbox.read",
        "tags": [
          "Inbox"
        ],
        "x-oppulence-required-scopes": [
          "inbox.read"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Cursor for pagination",
              "example": "eyJpZCI6IjEyMyJ9"
            },
            "required": false,
            "description": "Cursor for pagination",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Sort order (asc or desc)",
              "example": "desc"
            },
            "required": false,
            "description": "Sort order (asc or desc)",
            "name": "order",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Field to sort by",
              "example": "createdAt"
            },
            "required": false,
            "description": "Field to sort by",
            "name": "sort",
            "in": "query"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Number of items per page",
              "example": 50
            },
            "required": false,
            "description": "Number of items per page",
            "name": "pageSize",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Search query",
              "example": "invoice"
            },
            "required": false,
            "description": "Search query",
            "name": "q",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "done",
                "pending",
                "suggested_match",
                "no_match",
                null
              ],
              "description": "Filter by inbox item status",
              "example": "pending"
            },
            "required": false,
            "description": "Filter by inbox item status",
            "name": "status",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of inbox items for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "A cursor for pagination, representing the last item from the previous page.",
                          "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there is a previous page of results.",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there is a next page of results.",
                          "example": true
                        },
                        "totalCount": {
                          "type": "number",
                          "description": "Total number of items matching filters (without search).",
                          "example": 123
                        }
                      },
                      "required": [
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata for the inbox list response."
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Inbox item ID (UUID)",
                            "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                          },
                          "fileName": {
                            "type": "string",
                            "description": "Original file name of the uploaded document",
                            "example": "invoice-123.pdf"
                          },
                          "filePath": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Path segments to the file in storage",
                            "example": [
                              "inbox",
                              "2024",
                              "05",
                              "invoice-123.pdf"
                            ]
                          },
                          "displayName": {
                            "type": "string",
                            "description": "Display name for the inbox item",
                            "example": "Invoice May 2024"
                          },
                          "amount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Amount detected or entered for the inbox item",
                            "example": 123.45
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Currency code (ISO 4217) for the amount",
                            "example": "USD"
                          },
                          "contentType": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "MIME type of the uploaded file",
                            "example": "application/pdf"
                          },
                          "date": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Date associated with the inbox item (ISO 8601)",
                            "example": "2024-05-01"
                          },
                          "status": {
                            "type": "string",
                            "description": "Status of the inbox item",
                            "example": "pending"
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Date and time when the inbox item was created (ISO 8601)",
                            "example": "2024-05-01T12:34:56.789Z"
                          },
                          "website": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Website associated with the inbox item, if any",
                            "example": "https://vendor.com"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Description or notes for the inbox item",
                            "example": "Invoice for May 2024 services"
                          },
                          "transaction": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Transaction ID (UUID)",
                                "example": "a1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4"
                              },
                              "amount": {
                                "type": "number",
                                "description": "Transaction amount",
                                "example": 123.45
                              },
                              "currency": {
                                "type": "string",
                                "description": "Transaction currency (ISO 4217)",
                                "example": "USD"
                              },
                              "name": {
                                "type": "string",
                                "description": "Transaction name or payee",
                                "example": "Acme Corp"
                              },
                              "date": {
                                "type": "string",
                                "description": "Transaction date (ISO 8601)",
                                "example": "2024-05-01"
                              }
                            },
                            "required": [
                              "id",
                              "amount",
                              "currency",
                              "name",
                              "date"
                            ],
                            "description": "Matched transaction for this inbox item, if any"
                          }
                        },
                        "required": [
                          "id",
                          "fileName",
                          "filePath",
                          "displayName",
                          "amount",
                          "currency",
                          "contentType",
                          "date",
                          "status",
                          "createdAt",
                          "website",
                          "description",
                          "transaction"
                        ],
                        "description": "Inbox item object"
                      },
                      "description": "List of inbox items"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/inbox/{id}": {
      "get": {
        "summary": "Retrieve a inbox item",
        "operationId": "getInboxItemById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single inbox item by its UUID. Returns the item's metadata, attachment details, extracted data, and processing status. The item must belong to the authenticated team.\n\nRequired scopes: inbox.read",
        "tags": [
          "Inbox"
        ],
        "x-oppulence-required-scopes": [
          "inbox.read"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The unique identifier of the inbox item.",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "The unique identifier of the inbox item.",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve an inbox item by its ID.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Inbox item ID (UUID)",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    },
                    "fileName": {
                      "type": "string",
                      "description": "Original file name of the uploaded document",
                      "example": "invoice-123.pdf"
                    },
                    "filePath": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Path segments to the file in storage",
                      "example": [
                        "inbox",
                        "2024",
                        "05",
                        "invoice-123.pdf"
                      ]
                    },
                    "displayName": {
                      "type": "string",
                      "description": "Display name for the inbox item",
                      "example": "Invoice May 2024"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Amount detected or entered for the inbox item",
                      "example": 123.45
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code (ISO 4217) for the amount",
                      "example": "USD"
                    },
                    "contentType": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "MIME type of the uploaded file",
                      "example": "application/pdf"
                    },
                    "date": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Date associated with the inbox item (ISO 8601)",
                      "example": "2024-05-01"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the inbox item",
                      "example": "pending"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the inbox item was created (ISO 8601)",
                      "example": "2024-05-01T12:34:56.789Z"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Website associated with the inbox item, if any",
                      "example": "https://vendor.com"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Description or notes for the inbox item",
                      "example": "Invoice for May 2024 services"
                    },
                    "transaction": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Transaction ID (UUID)",
                          "example": "a1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4"
                        },
                        "amount": {
                          "type": "number",
                          "description": "Transaction amount",
                          "example": 123.45
                        },
                        "currency": {
                          "type": "string",
                          "description": "Transaction currency (ISO 4217)",
                          "example": "USD"
                        },
                        "name": {
                          "type": "string",
                          "description": "Transaction name or payee",
                          "example": "Acme Corp"
                        },
                        "date": {
                          "type": "string",
                          "description": "Transaction date (ISO 8601)",
                          "example": "2024-05-01"
                        }
                      },
                      "required": [
                        "id",
                        "amount",
                        "currency",
                        "name",
                        "date"
                      ],
                      "description": "Matched transaction for this inbox item, if any"
                    }
                  },
                  "required": [
                    "id",
                    "fileName",
                    "filePath",
                    "displayName",
                    "amount",
                    "currency",
                    "contentType",
                    "date",
                    "status",
                    "createdAt",
                    "website",
                    "description",
                    "transaction"
                  ],
                  "description": "Inbox item object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a inbox item",
        "operationId": "deleteInboxItem",
        "x-speakeasy-name-override": "delete",
        "description": "Permanently delete an inbox item by its UUID. The item must belong to the authenticated team. This removes the inbox record and its associated attachment references.\n\nRequired scopes: inbox.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Inbox"
        ],
        "x-oppulence-required-scopes": [
          "inbox.write"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The unique identifier of the inbox item to delete.",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "The unique identifier of the inbox item to delete.",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a inbox item by its ID.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The unique identifier of the deleted inbox item.",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "description": "Response schema for a successfully deleted inbox item."
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a inbox item",
        "operationId": "updateInboxItem",
        "x-speakeasy-name-override": "update",
        "description": "Update fields of an inbox item by its UUID. Use this to change the item's status, assign it to a transaction, or update extracted metadata. Only provided fields are modified. The item must belong to the authenticated team.\n\nRequired scopes: inbox.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Inbox"
        ],
        "x-oppulence-required-scopes": [
          "inbox.write"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "new",
                      "archived",
                      "processing",
                      "done",
                      "pending",
                      "deleted",
                      "analyzing",
                      "suggested_match"
                    ]
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update fields of an inbox item by its unique identifier for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Inbox item ID (UUID)",
                      "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
                    },
                    "fileName": {
                      "type": "string",
                      "description": "Original file name of the uploaded document",
                      "example": "invoice-123.pdf"
                    },
                    "filePath": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Path segments to the file in storage",
                      "example": [
                        "inbox",
                        "2024",
                        "05",
                        "invoice-123.pdf"
                      ]
                    },
                    "displayName": {
                      "type": "string",
                      "description": "Display name for the inbox item",
                      "example": "Invoice May 2024"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Amount detected or entered for the inbox item",
                      "example": 123.45
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code (ISO 4217) for the amount",
                      "example": "USD"
                    },
                    "contentType": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "MIME type of the uploaded file",
                      "example": "application/pdf"
                    },
                    "date": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Date associated with the inbox item (ISO 8601)",
                      "example": "2024-05-01"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the inbox item",
                      "example": "pending"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Date and time when the inbox item was created (ISO 8601)",
                      "example": "2024-05-01T12:34:56.789Z"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Website associated with the inbox item, if any",
                      "example": "https://vendor.com"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Description or notes for the inbox item",
                      "example": "Invoice for May 2024 services"
                    },
                    "transaction": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Transaction ID (UUID)",
                          "example": "a1b2c3d4-5678-4e7a-9c1a-2b7c1e24c2a4"
                        },
                        "amount": {
                          "type": "number",
                          "description": "Transaction amount",
                          "example": 123.45
                        },
                        "currency": {
                          "type": "string",
                          "description": "Transaction currency (ISO 4217)",
                          "example": "USD"
                        },
                        "name": {
                          "type": "string",
                          "description": "Transaction name or payee",
                          "example": "Acme Corp"
                        },
                        "date": {
                          "type": "string",
                          "description": "Transaction date (ISO 8601)",
                          "example": "2024-05-01"
                        }
                      },
                      "required": [
                        "id",
                        "amount",
                        "currency",
                        "name",
                        "date"
                      ],
                      "description": "Matched transaction for this inbox item, if any"
                    }
                  },
                  "required": [
                    "id",
                    "fileName",
                    "filePath",
                    "displayName",
                    "amount",
                    "currency",
                    "contentType",
                    "date",
                    "status",
                    "createdAt",
                    "website",
                    "description",
                    "transaction"
                  ],
                  "description": "Inbox item object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/inbox/{id}/presigned-url": {
      "post": {
        "summary": "Generate pre-signed URL for inbox attachment",
        "operationId": "getInboxPreSignedUrl",
        "x-speakeasy-name-override": "getPreSignedUrl",
        "description": "Generate a pre-signed URL for accessing an inbox attachment. The URL is valid for 60 seconds and allows secure temporary access to the attachment file.\n\nRequired scopes: inbox.read",
        "tags": [
          "Inbox"
        ],
        "x-oppulence-required-scopes": [
          "inbox.read"
        ],
        "security": [
          {
            "oauth2": [
              "inbox.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the inbox item to generate a pre-signed URL for",
              "example": "b3b7c1e2-4c2a-4e7a-9c1a-2b7c1e24c2a4"
            },
            "required": true,
            "description": "Unique identifier of the inbox item to generate a pre-signed URL for",
            "in": "path",
            "name": "id"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.",
              "example": true
            },
            "required": false,
            "description": "Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.",
            "in": "query",
            "name": "download"
          }
        ],
        "responses": {
          "200": {
            "description": "Pre-signed URL generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Pre-signed URL for accessing the inbox attachment, valid for 60 seconds",
                      "example": "https://service.eigenn.io/storage/v1/object/sign/vault/inbox/document.pdf?token=abc123&expires=1640995200"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO 8601 timestamp when the URL expires",
                      "example": "2024-04-15T10:01:00.000Z"
                    },
                    "fileName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Original filename of the inbox attachment",
                      "example": "invoice.pdf"
                    }
                  },
                  "required": [
                    "url",
                    "expiresAt",
                    "fileName"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Attachment file path not available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Inbox item not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error - Failed to generate pre-signed URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/invoices": {
      "get": {
        "description": "Retrieve a cursor-paginated list of invoices for the authenticated team. Results include customer metadata, calculated totals (subtotal, tax, VAT, amount), and delivery URLs (pdfUrl, previewUrl) when a token is available. Supports filtering by status, customer, date range, and sorting. Line item totals are recalculated from template tax settings.\n\nRequired scopes: invoices.read",
        "operationId": "listInvoices",
        "summary": "List all invoices",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "list",
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "description": "Maximum invoice total amount.",
              "example": 5000
            },
            "required": false,
            "description": "Maximum invoice total amount.",
            "in": "query",
            "name": "amountMax"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "description": "Minimum invoice total amount.",
              "example": 100
            },
            "required": false,
            "description": "Minimum invoice total amount.",
            "in": "query",
            "name": "amountMin"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "A cursor for pagination, representing the last item from the previous page.",
              "example": "25"
            },
            "required": false,
            "description": "A cursor for pagination, representing the last item from the previous page.",
            "in": "query",
            "name": "cursor"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "List of customer IDs to filter invoices.",
              "example": [
                "customer-uuid-1",
                "customer-uuid-2"
              ]
            },
            "required": false,
            "description": "List of customer IDs to filter invoices.",
            "in": "query",
            "name": "customers"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "End date (inclusive) for filtering invoices, in ISO 8601 format.",
              "example": "2024-01-31"
            },
            "required": false,
            "description": "End date (inclusive) for filtering invoices, in ISO 8601 format.",
            "in": "query",
            "name": "end"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "End issue date (inclusive) for filtering invoices, in ISO 8601 format.",
              "example": "2024-01-31"
            },
            "required": false,
            "description": "End issue date (inclusive) for filtering invoices, in ISO 8601 format.",
            "in": "query",
            "name": "issueEnd"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Start issue date (inclusive) for filtering invoices, in ISO 8601 format.",
              "example": "2024-01-01"
            },
            "required": false,
            "description": "Start issue date (inclusive) for filtering invoices, in ISO 8601 format.",
            "in": "query",
            "name": "issueStart"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Include recurring series metadata for each invoice when available.",
              "example": true
            },
            "required": false,
            "description": "Include recurring series metadata for each invoice when available.",
            "in": "query",
            "name": "includeRecurring"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Number of invoices to return per page (1-100).",
              "example": 25
            },
            "required": false,
            "description": "Number of invoices to return per page (1-100).",
            "in": "query",
            "name": "pageSize"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Search query string to filter invoices by text.",
              "example": "Acme"
            },
            "required": false,
            "description": "Search query string to filter invoices by text.",
            "in": "query",
            "name": "q"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Filter by recurring status. true = only recurring invoices, false = only non-recurring invoices.",
              "example": true
            },
            "required": false,
            "description": "Filter by recurring status. true = only recurring invoices, false = only non-recurring invoices.",
            "in": "query",
            "name": "recurring"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "List of recurring series IDs to filter invoices by (shows all invoices from these series).",
              "example": [
                "recurring-uuid-1",
                "recurring-uuid-2"
              ]
            },
            "required": false,
            "description": "List of recurring series IDs to filter invoices by (shows all invoices from these series).",
            "in": "query",
            "name": "recurringIds"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "End sent date (inclusive) for filtering invoices, in ISO 8601 format.",
              "example": "2024-01-31"
            },
            "required": false,
            "description": "End sent date (inclusive) for filtering invoices, in ISO 8601 format.",
            "in": "query",
            "name": "sentEnd"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Start sent date (inclusive) for filtering invoices, in ISO 8601 format.",
              "example": "2024-01-01"
            },
            "required": false,
            "description": "Start sent date (inclusive) for filtering invoices, in ISO 8601 format.",
            "in": "query",
            "name": "sentStart"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "prefixItems": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Sorting order as a tuple: [field, direction]. Example: ['createdAt', 'desc'].",
              "example": [
                "createdAt",
                "desc"
              ]
            },
            "required": false,
            "description": "Sorting order as a tuple: [field, direction]. Example: ['createdAt', 'desc'].",
            "in": "query",
            "name": "sort"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Start date (inclusive) for filtering invoices, in ISO 8601 format.",
              "example": "2024-01-01"
            },
            "required": false,
            "description": "Start date (inclusive) for filtering invoices, in ISO 8601 format.",
            "in": "query",
            "name": "start"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "List of invoice statuses to filter by (e.g., 'paid', 'unpaid', 'overdue').",
              "example": [
                "paid",
                "unpaid"
              ]
            },
            "required": false,
            "description": "List of invoice statuses to filter by (e.g., 'paid', 'unpaid', 'overdue').",
            "in": "query",
            "name": "statuses"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "description": "Maximum invoice tax amount.",
              "example": 500
            },
            "required": false,
            "description": "Maximum invoice tax amount.",
            "in": "query",
            "name": "taxMax"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "description": "Minimum invoice tax amount.",
              "example": 0
            },
            "required": false,
            "description": "Minimum invoice tax amount.",
            "in": "query",
            "name": "taxMin"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "description": "Maximum invoice VAT amount.",
              "example": 500
            },
            "required": false,
            "description": "Maximum invoice VAT amount.",
            "in": "query",
            "name": "vatMax"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "description": "Minimum invoice VAT amount.",
              "example": 0
            },
            "required": false,
            "description": "Minimum invoice VAT amount.",
            "in": "query",
            "name": "vatMin"
          }
        ],
        "responses": {
          "200": {
            "description": "A list of invoices for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page of results, null if no more pages",
                          "example": "eyJ0eXBlIjoib2Zmc2V0Iiwib2Zmc2V0IjoyNX0"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there are results on the previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there are more results on the next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ],
                      "description": "Pagination metadata"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier for the invoice",
                            "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                          },
                          "amount": {
                            "type": "number",
                            "description": "Total amount of the invoice",
                            "example": 1500.75
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Timestamp when the invoice was created (ISO 8601)",
                            "example": "2024-06-01T07:00:00.000Z"
                          },
                          "currency": {
                            "type": "string",
                            "description": "Currency code (ISO 4217) for the invoice amount",
                            "example": "USD"
                          },
                          "customer": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier for the customer",
                                "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                              },
                              "email": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "email",
                                "description": "Email address of the customer",
                                "example": "info@acme.com"
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the customer",
                                "example": "Acme Corporation"
                              },
                              "website": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Website URL of the customer",
                                "example": "https://acme.com"
                              }
                            },
                            "required": [
                              "id",
                              "email",
                              "name",
                              "website"
                            ],
                            "description": "Customer details"
                          },
                          "customerName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Name of the customer as shown on the invoice, or null if not set",
                            "example": "Acme Corporation"
                          },
                          "discount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Discount amount applied to the invoice, or null if none",
                            "example": 50
                          },
                          "dueDate": {
                            "type": "string",
                            "description": "Due date of the invoice in ISO 8601 format",
                            "example": "2024-06-30T23:59:59.000Z"
                          },
                          "invoiceNumber": {
                            "type": "string",
                            "description": "Invoice number as shown to the customer (auto-generated if not provided)",
                            "example": "INV-2024-001"
                          },
                          "invoiceRecurringId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid",
                            "description": "Recurring series ID if this invoice is part of a series",
                            "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                          },
                          "issueDate": {
                            "type": "string",
                            "description": "Issue date of the invoice in ISO 8601 format",
                            "example": "2024-06-01T00:00:00.000Z"
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Optional note attached to the invoice",
                            "example": "Thank you for your business."
                          },
                          "paidAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Timestamp when the invoice was paid (ISO 8601), or null if unpaid",
                            "example": "2024-06-15T12:00:00.000Z"
                          },
                          "pdfUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri",
                            "description": "URL to download the invoice PDF, or null if not generated",
                            "example": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390"
                          },
                          "previewUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri",
                            "description": "URL to preview the invoice in the browser, or null if not generated",
                            "example": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390"
                          },
                          "recurring": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "endCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Total invoices to generate (if endType is 'after_count')",
                                "example": 12
                              },
                              "endDate": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "End date for the series (if endType is 'on_date')",
                                "example": null
                              },
                              "endType": {
                                "type": "string",
                                "enum": [
                                  "never",
                                  "on_date",
                                  "after_count"
                                ],
                                "description": "How the recurring series ends",
                                "example": "after_count"
                              },
                              "frequency": {
                                "type": "string",
                                "enum": [
                                  "weekly",
                                  "biweekly",
                                  "monthly_date",
                                  "monthly_weekday",
                                  "monthly_last_day",
                                  "quarterly",
                                  "semi_annual",
                                  "annual",
                                  "custom"
                                ],
                                "description": "Frequency of the series",
                                "example": "monthly_date"
                              },
                              "frequencyDay": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Day parameter for frequency",
                                "example": 15
                              },
                              "frequencyInterval": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Interval for custom frequency (days between invoices)",
                                "example": null
                              },
                              "frequencyWeek": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Week parameter for monthly_weekday frequency",
                                "example": null
                              },
                              "invoicesGenerated": {
                                "type": "number",
                                "description": "Number of invoices generated so far",
                                "example": 3
                              },
                              "nextScheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Next scheduled invoice date",
                                "example": "2026-02-15T00:00:00.000Z"
                              },
                              "recurringId": {
                                "type": "string",
                                "format": "uuid",
                                "description": "ID of the recurring invoice series",
                                "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                              },
                              "sequence": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Sequence number of this invoice in the series (e.g., 3 for 3rd invoice)",
                                "example": 3
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "paused",
                                  "completed",
                                  "canceled"
                                ],
                                "description": "Status of the recurring series",
                                "example": "active"
                              },
                              "totalCount": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Total count if series has a limit (null if no end)",
                                "example": 12
                              }
                            },
                            "required": [
                              "endCount",
                              "endDate",
                              "endType",
                              "frequency",
                              "frequencyDay",
                              "frequencyInterval",
                              "frequencyWeek",
                              "invoicesGenerated",
                              "nextScheduledAt",
                              "recurringId",
                              "status"
                            ],
                            "description": "Recurring series metadata for this invoice"
                          },
                          "recurringSequence": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Sequence number of this invoice in the recurring series",
                            "example": 3
                          },
                          "reminderSentAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Timestamp when a payment reminder was sent (ISO 8601), or null if never sent",
                            "example": "2024-06-10T09:00:00.000Z"
                          },
                          "sentAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Timestamp when the invoice was sent (ISO 8601), or null if not sent",
                            "example": "2024-06-02T08:00:00.000Z"
                          },
                          "sentTo": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "email",
                            "description": "Email address to which the invoice was sent, or null if not sent",
                            "example": "billing@acme.com"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "overdue",
                              "paid",
                              "unpaid",
                              "canceled",
                              "scheduled"
                            ],
                            "description": "Current status of the invoice",
                            "example": "paid"
                          },
                          "subtotal": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Subtotal before taxes and discounts, or null if not calculated",
                            "example": 1400
                          },
                          "tax": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Tax amount, or null if not applicable",
                            "example": 80
                          },
                          "updatedAt": {
                            "type": "string",
                            "description": "Timestamp when the invoice was last updated (ISO 8601)",
                            "example": "2024-06-15T10:00:00.000Z"
                          },
                          "vat": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Value-added tax amount, or null if not applicable",
                            "example": 120
                          },
                          "viewedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Timestamp when the invoice was viewed by the customer (ISO 8601), or null if never viewed",
                            "example": "2024-06-05T14:30:00.000Z"
                          }
                        },
                        "required": [
                          "id",
                          "amount",
                          "createdAt",
                          "currency",
                          "customer",
                          "customerName",
                          "discount",
                          "dueDate",
                          "issueDate",
                          "note",
                          "paidAt",
                          "pdfUrl",
                          "previewUrl",
                          "reminderSentAt",
                          "sentAt",
                          "sentTo",
                          "status",
                          "subtotal",
                          "tax",
                          "updatedAt",
                          "vat",
                          "viewedAt"
                        ],
                        "description": "Invoice object"
                      },
                      "description": "Array of invoice objects"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ],
                  "description": "Response containing a list of invoices and pagination metadata"
                },
                "example": {
                  "data": [
                    {
                      "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                      "amount": 1085,
                      "createdAt": "2024-06-01T07:00:00.000Z",
                      "currency": "USD",
                      "customer": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "email": "billing@acme.com",
                        "name": "Acme Corporation",
                        "website": "https://acme.com"
                      },
                      "customerName": "Acme Corporation",
                      "discount": 0,
                      "dueDate": "2024-06-30T23:59:59.000Z",
                      "invoiceNumber": "INV-2024-001",
                      "issueDate": "2024-06-01T00:00:00.000Z",
                      "note": "Payment due within 30 days.",
                      "paidAt": null,
                      "pdfUrl": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390",
                      "previewUrl": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390",
                      "reminderSentAt": "2024-06-10T09:00:00.000Z",
                      "sentAt": "2024-06-02T08:00:00.000Z",
                      "sentTo": "billing@acme.com",
                      "status": "unpaid",
                      "subtotal": 1000,
                      "tax": 85,
                      "updatedAt": "2024-06-15T10:00:00.000Z",
                      "vat": null,
                      "viewedAt": "2024-06-05T14:30:00.000Z"
                    },
                    {
                      "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                      "amount": 1085,
                      "createdAt": "2024-06-01T07:00:00.000Z",
                      "currency": "USD",
                      "customer": {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "email": "billing@acme.com",
                        "name": "Acme Corporation",
                        "website": "https://acme.com"
                      },
                      "customerName": "Acme Corporation",
                      "discount": 0,
                      "dueDate": "2024-06-30T23:59:59.000Z",
                      "invoiceNumber": "INV-2024-001",
                      "issueDate": "2024-06-01T00:00:00.000Z",
                      "note": "Payment due within 30 days.",
                      "paidAt": "2024-06-15T12:00:00.000Z",
                      "pdfUrl": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390",
                      "previewUrl": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390",
                      "reminderSentAt": "2024-06-10T09:00:00.000Z",
                      "sentAt": "2024-06-02T08:00:00.000Z",
                      "sentTo": "billing@acme.com",
                      "status": "paid",
                      "subtotal": 1000,
                      "tax": 85,
                      "updatedAt": "2024-06-15T12:05:00.000Z",
                      "vat": null,
                      "viewedAt": "2024-06-05T14:30:00.000Z"
                    }
                  ],
                  "meta": {
                    "cursor": "25",
                    "hasNextPage": true,
                    "hasPreviousPage": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Create an invoice for the authenticated team. Behavior depends on deliveryType: 'create' generates and finalizes the invoice immediately as unpaid; 'create_and_send' also triggers email delivery to the customer; 'scheduled' schedules the invoice for future processing at scheduledAt (must be in the future). If invoiceNumber is omitted, the next sequential number is auto-generated. Returns 409 if the provided invoice number already exists. Returns 404 if the customerId doesn't match an existing customer.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "createInvoice",
        "summary": "Create an invoice",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "create",
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Provide invoice content, customer details, and delivery settings. Use deliveryType to control immediate creation, sending, or scheduling.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Total amount of the invoice",
                    "example": 1500.75
                  },
                  "bottomBlock": {
                    "type": "object",
                    "description": "Custom content block to display at the bottom of the invoice in TipTap JSONContent format",
                    "example": {
                      "content": [
                        {
                          "content": [
                            {
                              "marks": [
                                {
                                  "type": "bold"
                                }
                              ],
                              "text": "Acme Inc",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "123 Main St, City, Country",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Visit our website: ",
                              "type": "text"
                            },
                            {
                              "marks": [
                                {
                                  "attrs": {
                                    "href": "https://acme.com"
                                  },
                                  "type": "link"
                                }
                              ],
                              "text": "https://acme.com",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    }
                  },
                  "customerId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Unique identifier for the customer (required)",
                    "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  },
                  "deliveryType": {
                    "type": "string",
                    "enum": [
                      "create",
                      "create_and_send",
                      "scheduled"
                    ],
                    "description": "How the invoice should be processed: 'create' - finalize immediately, 'create_and_send' - finalize and send to customer, 'scheduled' - schedule for automatic processing at specified date",
                    "example": "create"
                  },
                  "discount": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Discount applied to the invoice",
                    "example": 100
                  },
                  "dueDate": {
                    "type": "string",
                    "description": "Due date of the invoice in ISO 8601 format",
                    "example": "2024-06-30T23:59:59.000Z"
                  },
                  "fromDetails": {
                    "type": "object",
                    "description": "Sender details in TipTap JSONContent format",
                    "example": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Acme Inc, 123 Main St, City, Country",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    }
                  },
                  "invoiceNumber": {
                    "type": "string",
                    "description": "Invoice number as shown to the customer (auto-generated if not provided)",
                    "example": "INV-2024-001"
                  },
                  "issueDate": {
                    "type": "string",
                    "description": "Issue date of the invoice in ISO 8601 format",
                    "example": "2024-06-01T00:00:00.000Z"
                  },
                  "lineItems": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "type": "number"
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0
                        },
                        "tax": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "taxRate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 100
                        },
                        "unit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "vat": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "name": {
                          "type": "object",
                          "description": "Line item description in TipTap JSONContent format",
                          "example": {
                            "content": [
                              {
                                "content": [
                                  {
                                    "text": "Web Development Services",
                                    "type": "text"
                                  }
                                ],
                                "type": "paragraph"
                              }
                            ],
                            "type": "doc"
                          }
                        },
                        "productId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Optional reference to a saved product",
                          "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                        }
                      }
                    },
                    "description": "List of line items for the invoice"
                  },
                  "logoUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "URL of the logo to display on the invoice",
                    "example": "https://example.com/logo.png"
                  },
                  "noteDetails": {
                    "type": "object",
                    "description": "Additional notes for the invoice in TipTap JSONContent format",
                    "example": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Thank you for your business.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    }
                  },
                  "paymentDetails": {
                    "type": "object",
                    "description": "Payment details in TipTap JSONContent format",
                    "example": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Bank: 123456, IBAN: DE1234567890",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    }
                  },
                  "scheduledAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Scheduled date of the invoice in ISO 8601 format. Required when deliveryType is 'scheduled'. Must be in the future.",
                    "example": "2024-06-30T23:59:59.000Z"
                  },
                  "tax": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Tax amount for the invoice",
                    "example": 50
                  },
                  "template": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "type": "string"
                      },
                      "customerLabel": {
                        "type": "string"
                      },
                      "dateFormat": {
                        "type": "string"
                      },
                      "deliveryType": {
                        "type": "string",
                        "enum": [
                          "create",
                          "create_and_send",
                          "scheduled"
                        ]
                      },
                      "descriptionLabel": {
                        "type": "string"
                      },
                      "discountLabel": {
                        "type": "string"
                      },
                      "dueDateLabel": {
                        "type": "string"
                      },
                      "fromLabel": {
                        "type": "string"
                      },
                      "includeDecimals": {
                        "type": "boolean"
                      },
                      "includeDiscount": {
                        "type": "boolean"
                      },
                      "includeLineItemTax": {
                        "type": "boolean"
                      },
                      "includePdf": {
                        "type": "boolean"
                      },
                      "includeQr": {
                        "type": "boolean"
                      },
                      "includeTax": {
                        "type": "boolean"
                      },
                      "includeUnits": {
                        "type": "boolean"
                      },
                      "includeVat": {
                        "type": "boolean"
                      },
                      "invoiceNoLabel": {
                        "type": "string"
                      },
                      "issueDateLabel": {
                        "type": "string"
                      },
                      "lineItemTaxLabel": {
                        "type": "string"
                      },
                      "locale": {
                        "type": "string"
                      },
                      "logoUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "noteLabel": {
                        "type": "string"
                      },
                      "paymentEnabled": {
                        "type": "boolean"
                      },
                      "paymentLabel": {
                        "type": "string"
                      },
                      "paymentTermsDays": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "priceLabel": {
                        "type": "string"
                      },
                      "quantityLabel": {
                        "type": "string"
                      },
                      "sendCopy": {
                        "type": "boolean"
                      },
                      "size": {
                        "type": "string",
                        "enum": [
                          "a4",
                          "letter"
                        ]
                      },
                      "subtotalLabel": {
                        "type": "string"
                      },
                      "taxLabel": {
                        "type": "string"
                      },
                      "taxRate": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                      },
                      "timezone": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "totalLabel": {
                        "type": "string"
                      },
                      "totalSummaryLabel": {
                        "type": "string"
                      },
                      "vatLabel": {
                        "type": "string"
                      },
                      "vatRate": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                      },
                      "fromDetails": {
                        "type": "object",
                        "description": "Sender details in TipTap JSONContent format",
                        "example": {
                          "content": [
                            {
                              "content": [
                                {
                                  "marks": [
                                    {
                                      "type": "bold"
                                    }
                                  ],
                                  "text": "Acme Inc",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "123 Main St, City, Country",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "Visit our website: ",
                                  "type": "text"
                                },
                                {
                                  "marks": [
                                    {
                                      "attrs": {
                                        "href": "https://acme.com"
                                      },
                                      "type": "link"
                                    }
                                  ],
                                  "text": "https://acme.com",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        }
                      },
                      "noteDetails": {
                        "type": "object",
                        "description": "Default footer notes in TipTap JSONContent format for new invoices",
                        "example": {
                          "content": [
                            {
                              "content": [
                                {
                                  "marks": [
                                    {
                                      "type": "bold"
                                    }
                                  ],
                                  "text": "Acme Inc",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "123 Main St, City, Country",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "Visit our website: ",
                                  "type": "text"
                                },
                                {
                                  "marks": [
                                    {
                                      "attrs": {
                                        "href": "https://acme.com"
                                      },
                                      "type": "link"
                                    }
                                  ],
                                  "text": "https://acme.com",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        }
                      },
                      "paymentDetails": {
                        "type": "object",
                        "description": "Payment details in TipTap JSONContent format",
                        "example": {
                          "content": [
                            {
                              "content": [
                                {
                                  "marks": [
                                    {
                                      "type": "bold"
                                    }
                                  ],
                                  "text": "Acme Inc",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "123 Main St, City, Country",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "Visit our website: ",
                                  "type": "text"
                                },
                                {
                                  "marks": [
                                    {
                                      "attrs": {
                                        "href": "https://acme.com"
                                      },
                                      "type": "link"
                                    }
                                  ],
                                  "text": "https://acme.com",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        }
                      }
                    },
                    "description": "Invoice template details"
                  },
                  "topBlock": {
                    "type": "object",
                    "description": "Custom content block to display at the top of the invoice in TipTap JSONContent format",
                    "example": {
                      "content": [
                        {
                          "content": [
                            {
                              "marks": [
                                {
                                  "type": "bold"
                                }
                              ],
                              "text": "Acme Inc",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "123 Main St, City, Country",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Visit our website: ",
                              "type": "text"
                            },
                            {
                              "marks": [
                                {
                                  "attrs": {
                                    "href": "https://acme.com"
                                  },
                                  "type": "link"
                                }
                              ],
                              "text": "https://acme.com",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    }
                  },
                  "vat": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "VAT amount for the invoice",
                    "example": 150
                  }
                },
                "required": [
                  "customerId",
                  "deliveryType",
                  "dueDate",
                  "issueDate",
                  "template"
                ],
                "description": "Schema for creating an invoice. The deliveryType determines if it stays as a draft, gets finalized immediately, or gets scheduled for later processing.",
                "example": {
                  "amount": 1085,
                  "bottomBlock": {
                    "content": [
                      {
                        "content": [
                          {
                            "marks": [
                              {
                                "type": "strong"
                              }
                            ],
                            "text": "Terms & Conditions:",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "content": [
                              {
                                "content": [
                                  {
                                    "text": "Payment is due within 30 days of invoice date",
                                    "type": "text"
                                  }
                                ],
                                "type": "paragraph"
                              }
                            ],
                            "type": "listItem"
                          },
                          {
                            "content": [
                              {
                                "content": [
                                  {
                                    "text": "Late payments may incur a 1.5% monthly service charge",
                                    "type": "text"
                                  }
                                ],
                                "type": "paragraph"
                              }
                            ],
                            "type": "listItem"
                          },
                          {
                            "content": [
                              {
                                "content": [
                                  {
                                    "text": "All work is subject to our standard terms of service",
                                    "type": "text"
                                  }
                                ],
                                "type": "paragraph"
                              }
                            ],
                            "type": "listItem"
                          }
                        ],
                        "type": "bulletList"
                      },
                      {
                        "content": [
                          {
                            "marks": [
                              {
                                "type": "italic"
                              }
                            ],
                            "text": "Questions? Contact us at billing@techcorp.com or (555) 123-4567",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      }
                    ],
                    "type": "doc"
                  },
                  "customerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                  "deliveryType": "create",
                  "dueDate": "2024-07-15T23:59:59.000Z",
                  "fromDetails": {
                    "content": [
                      {
                        "content": [
                          {
                            "marks": [
                              {
                                "type": "strong"
                              }
                            ],
                            "text": "TechCorp Inc",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "text": "123 Business Ave",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "text": "San Francisco, CA 94105",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      }
                    ],
                    "type": "doc"
                  },
                  "invoiceNumber": "INV-2024-001",
                  "issueDate": "2024-06-15T00:00:00.000Z",
                  "lineItems": [
                    {
                      "name": {
                        "content": [
                          {
                            "content": [
                              {
                                "marks": [
                                  {
                                    "type": "strong"
                                  }
                                ],
                                "text": "Web Development Services",
                                "type": "text"
                              }
                            ],
                            "type": "paragraph"
                          },
                          {
                            "content": [
                              {
                                "marks": [
                                  {
                                    "type": "italic"
                                  }
                                ],
                                "text": "Custom React application with TypeScript",
                                "type": "text"
                              }
                            ],
                            "type": "paragraph"
                          }
                        ],
                        "type": "doc"
                      },
                      "price": 75,
                      "quantity": 40,
                      "tax": 8.5
                    },
                    {
                      "name": {
                        "content": [
                          {
                            "content": [
                              {
                                "marks": [
                                  {
                                    "type": "strong"
                                  }
                                ],
                                "text": "UI/UX Design",
                                "type": "text"
                              }
                            ],
                            "type": "paragraph"
                          },
                          {
                            "content": [
                              {
                                "marks": [
                                  {
                                    "type": "italic"
                                  }
                                ],
                                "text": "User interface design and user experience optimization",
                                "type": "text"
                              }
                            ],
                            "type": "paragraph"
                          }
                        ],
                        "type": "doc"
                      },
                      "price": 50,
                      "quantity": 20,
                      "tax": 8.5
                    }
                  ],
                  "logoUrl": "https://example.com/logo.png",
                  "noteDetails": {
                    "content": [
                      {
                        "content": [
                          {
                            "text": "Payment is due within 30 days of invoice date.",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "marks": [
                              {
                                "type": "italic"
                              }
                            ],
                            "text": "Thank you for your business!",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      }
                    ],
                    "type": "doc"
                  },
                  "paymentDetails": {
                    "content": [
                      {
                        "content": [
                          {
                            "marks": [
                              {
                                "type": "strong"
                              }
                            ],
                            "text": "Wire Transfer:",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "text": "Chase Bank, Account: 1234567890",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "text": "Routing: 021000021",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      }
                    ],
                    "type": "doc"
                  },
                  "scheduledAt": "2024-07-01T09:00:00.000Z",
                  "tax": 85,
                  "template": {
                    "currency": "USD",
                    "customerLabel": "Bill To",
                    "dateFormat": "MM/dd/yyyy",
                    "deliveryType": "create",
                    "descriptionLabel": "Description",
                    "discountLabel": "Discount",
                    "dueDateLabel": "Due Date",
                    "fromDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "TechCorp Inc, 123 Business Ave, San Francisco, CA 94105",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "fromLabel": "From",
                    "includeDecimals": true,
                    "includeDiscount": false,
                    "includePdf": true,
                    "includeQr": false,
                    "includeTax": true,
                    "includeUnits": true,
                    "includeVat": false,
                    "invoiceNoLabel": "Invoice #",
                    "issueDateLabel": "Issue Date",
                    "locale": "en-US",
                    "logoUrl": "https://example.com/logo.png",
                    "noteLabel": "Notes",
                    "paymentDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Wire Transfer: Chase Bank, Account: 1234567890, Routing: 021000021",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "paymentLabel": "Payment Information",
                    "priceLabel": "Rate",
                    "quantityLabel": "Qty",
                    "sendCopy": true,
                    "size": "letter",
                    "taxLabel": "Sales Tax",
                    "taxRate": 8.5,
                    "timezone": "America/Los_Angeles",
                    "title": "Invoice",
                    "totalLabel": "Amount",
                    "totalSummaryLabel": "Total",
                    "vatLabel": "VAT",
                    "vatRate": 0
                  },
                  "topBlock": {
                    "content": [
                      {
                        "content": [
                          {
                            "marks": [
                              {
                                "type": "strong"
                              }
                            ],
                            "text": "Thank you for choosing TechCorp for your software development needs.",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      },
                      {
                        "content": [
                          {
                            "text": "This invoice covers the development work completed in June 2024.",
                            "type": "text"
                          }
                        ],
                        "type": "paragraph"
                      }
                    ],
                    "type": "doc"
                  }
                }
              },
              "examples": {
                "create": {
                  "summary": "Create and finalize immediately",
                  "value": {
                    "amount": 1085,
                    "bottomBlock": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Terms & Conditions:",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "content": [
                                {
                                  "content": [
                                    {
                                      "text": "Payment is due within 30 days of invoice date",
                                      "type": "text"
                                    }
                                  ],
                                  "type": "paragraph"
                                }
                              ],
                              "type": "listItem"
                            },
                            {
                              "content": [
                                {
                                  "content": [
                                    {
                                      "text": "Late payments may incur a 1.5% monthly service charge",
                                      "type": "text"
                                    }
                                  ],
                                  "type": "paragraph"
                                }
                              ],
                              "type": "listItem"
                            }
                          ],
                          "type": "bulletList"
                        }
                      ],
                      "type": "doc"
                    },
                    "customerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "discount": 0,
                    "dueDate": "2024-07-15T23:59:59.000Z",
                    "fromDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "TechCorp Inc",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "123 Business Ave",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "San Francisco, CA 94105",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "invoiceNumber": "INV-2024-001",
                    "issueDate": "2024-06-15T00:00:00.000Z",
                    "lineItems": [
                      {
                        "name": {
                          "content": [
                            {
                              "content": [
                                {
                                  "text": "Web Development Services",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "Custom React application with TypeScript",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        },
                        "price": 75,
                        "quantity": 40,
                        "tax": 8.5,
                        "unit": "hours"
                      },
                      {
                        "name": {
                          "content": [
                            {
                              "content": [
                                {
                                  "text": "UI/UX Design",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "User interface design and experience optimization",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        },
                        "price": 50,
                        "quantity": 20,
                        "tax": 8.5,
                        "unit": "hours"
                      }
                    ],
                    "logoUrl": "https://example.com/logo.png",
                    "noteDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Payment is due within 30 days of invoice date.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Thank you for your business!",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "paymentDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Wire Transfer:",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Chase Bank, Account: 1234567890",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Routing: 021000021",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "tax": 85,
                    "template": {
                      "currency": "USD",
                      "customerLabel": "Bill To",
                      "dateFormat": "MM/dd/yyyy",
                      "descriptionLabel": "Description",
                      "dueDateLabel": "Due Date",
                      "fromLabel": "From",
                      "includeDecimals": true,
                      "includeDiscount": false,
                      "includePdf": true,
                      "includeQr": false,
                      "includeTax": true,
                      "includeUnits": true,
                      "includeVat": false,
                      "invoiceNoLabel": "Invoice #",
                      "issueDateLabel": "Issue Date",
                      "locale": "en-US",
                      "logoUrl": "https://example.com/logo.png",
                      "noteLabel": "Notes",
                      "paymentLabel": "Payment Information",
                      "priceLabel": "Rate",
                      "quantityLabel": "Qty",
                      "sendCopy": true,
                      "size": "letter",
                      "taxLabel": "Sales Tax",
                      "taxRate": 8.5,
                      "timezone": "America/Los_Angeles",
                      "title": "Invoice",
                      "totalLabel": "Amount",
                      "totalSummaryLabel": "Total",
                      "vatLabel": "VAT",
                      "vatRate": 0
                    },
                    "topBlock": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Thank you for choosing TechCorp for your software development needs.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "vat": null,
                    "deliveryType": "create"
                  }
                },
                "createAndSend": {
                  "summary": "Create, finalize, and email the customer",
                  "value": {
                    "amount": 1085,
                    "bottomBlock": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Terms & Conditions:",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "content": [
                                {
                                  "content": [
                                    {
                                      "text": "Payment is due within 30 days of invoice date",
                                      "type": "text"
                                    }
                                  ],
                                  "type": "paragraph"
                                }
                              ],
                              "type": "listItem"
                            },
                            {
                              "content": [
                                {
                                  "content": [
                                    {
                                      "text": "Late payments may incur a 1.5% monthly service charge",
                                      "type": "text"
                                    }
                                  ],
                                  "type": "paragraph"
                                }
                              ],
                              "type": "listItem"
                            }
                          ],
                          "type": "bulletList"
                        }
                      ],
                      "type": "doc"
                    },
                    "customerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "discount": 0,
                    "dueDate": "2024-07-15T23:59:59.000Z",
                    "fromDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "TechCorp Inc",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "123 Business Ave",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "San Francisco, CA 94105",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "invoiceNumber": "INV-2024-002",
                    "issueDate": "2024-06-15T00:00:00.000Z",
                    "lineItems": [
                      {
                        "name": {
                          "content": [
                            {
                              "content": [
                                {
                                  "text": "Web Development Services",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "Custom React application with TypeScript",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        },
                        "price": 75,
                        "quantity": 40,
                        "tax": 8.5,
                        "unit": "hours"
                      },
                      {
                        "name": {
                          "content": [
                            {
                              "content": [
                                {
                                  "text": "UI/UX Design",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "User interface design and experience optimization",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        },
                        "price": 50,
                        "quantity": 20,
                        "tax": 8.5,
                        "unit": "hours"
                      }
                    ],
                    "logoUrl": "https://example.com/logo.png",
                    "noteDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Payment is due within 30 days of invoice date.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Thank you for your business!",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "paymentDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Wire Transfer:",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Chase Bank, Account: 1234567890",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Routing: 021000021",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "tax": 85,
                    "template": {
                      "currency": "USD",
                      "customerLabel": "Bill To",
                      "dateFormat": "MM/dd/yyyy",
                      "descriptionLabel": "Description",
                      "dueDateLabel": "Due Date",
                      "fromLabel": "From",
                      "includeDecimals": true,
                      "includeDiscount": false,
                      "includePdf": true,
                      "includeQr": false,
                      "includeTax": true,
                      "includeUnits": true,
                      "includeVat": false,
                      "invoiceNoLabel": "Invoice #",
                      "issueDateLabel": "Issue Date",
                      "locale": "en-US",
                      "logoUrl": "https://example.com/logo.png",
                      "noteLabel": "Notes",
                      "paymentLabel": "Payment Information",
                      "priceLabel": "Rate",
                      "quantityLabel": "Qty",
                      "sendCopy": true,
                      "size": "letter",
                      "taxLabel": "Sales Tax",
                      "taxRate": 8.5,
                      "timezone": "America/Los_Angeles",
                      "title": "Invoice",
                      "totalLabel": "Amount",
                      "totalSummaryLabel": "Total",
                      "vatLabel": "VAT",
                      "vatRate": 0
                    },
                    "topBlock": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Thank you for choosing TechCorp for your software development needs.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "vat": null,
                    "deliveryType": "create_and_send"
                  }
                },
                "scheduled": {
                  "summary": "Schedule invoice for later processing",
                  "value": {
                    "amount": 1085,
                    "bottomBlock": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Terms & Conditions:",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "content": [
                                {
                                  "content": [
                                    {
                                      "text": "Payment is due within 30 days of invoice date",
                                      "type": "text"
                                    }
                                  ],
                                  "type": "paragraph"
                                }
                              ],
                              "type": "listItem"
                            },
                            {
                              "content": [
                                {
                                  "content": [
                                    {
                                      "text": "Late payments may incur a 1.5% monthly service charge",
                                      "type": "text"
                                    }
                                  ],
                                  "type": "paragraph"
                                }
                              ],
                              "type": "listItem"
                            }
                          ],
                          "type": "bulletList"
                        }
                      ],
                      "type": "doc"
                    },
                    "customerId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "discount": 0,
                    "dueDate": "2024-07-15T23:59:59.000Z",
                    "fromDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "TechCorp Inc",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "123 Business Ave",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "San Francisco, CA 94105",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "invoiceNumber": "INV-2024-003",
                    "issueDate": "2024-06-15T00:00:00.000Z",
                    "lineItems": [
                      {
                        "name": {
                          "content": [
                            {
                              "content": [
                                {
                                  "text": "Web Development Services",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "Custom React application with TypeScript",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        },
                        "price": 75,
                        "quantity": 40,
                        "tax": 8.5,
                        "unit": "hours"
                      },
                      {
                        "name": {
                          "content": [
                            {
                              "content": [
                                {
                                  "text": "UI/UX Design",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            },
                            {
                              "content": [
                                {
                                  "text": "User interface design and experience optimization",
                                  "type": "text"
                                }
                              ],
                              "type": "paragraph"
                            }
                          ],
                          "type": "doc"
                        },
                        "price": 50,
                        "quantity": 20,
                        "tax": 8.5,
                        "unit": "hours"
                      }
                    ],
                    "logoUrl": "https://example.com/logo.png",
                    "noteDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Payment is due within 30 days of invoice date.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Thank you for your business!",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "paymentDetails": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Wire Transfer:",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Chase Bank, Account: 1234567890",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        },
                        {
                          "content": [
                            {
                              "text": "Routing: 021000021",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "tax": 85,
                    "template": {
                      "currency": "USD",
                      "customerLabel": "Bill To",
                      "dateFormat": "MM/dd/yyyy",
                      "descriptionLabel": "Description",
                      "dueDateLabel": "Due Date",
                      "fromLabel": "From",
                      "includeDecimals": true,
                      "includeDiscount": false,
                      "includePdf": true,
                      "includeQr": false,
                      "includeTax": true,
                      "includeUnits": true,
                      "includeVat": false,
                      "invoiceNoLabel": "Invoice #",
                      "issueDateLabel": "Issue Date",
                      "locale": "en-US",
                      "logoUrl": "https://example.com/logo.png",
                      "noteLabel": "Notes",
                      "paymentLabel": "Payment Information",
                      "priceLabel": "Rate",
                      "quantityLabel": "Qty",
                      "sendCopy": true,
                      "size": "letter",
                      "taxLabel": "Sales Tax",
                      "taxRate": 8.5,
                      "timezone": "America/Los_Angeles",
                      "title": "Invoice",
                      "totalLabel": "Amount",
                      "totalSummaryLabel": "Total",
                      "vatLabel": "VAT",
                      "vatRate": 0
                    },
                    "topBlock": {
                      "content": [
                        {
                          "content": [
                            {
                              "text": "Thank you for choosing TechCorp for your software development needs.",
                              "type": "text"
                            }
                          ],
                          "type": "paragraph"
                        }
                      ],
                      "type": "doc"
                    },
                    "vat": null,
                    "deliveryType": "scheduled",
                    "scheduledAt": "2024-07-01T09:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Invoice created successfully. Status depends on deliveryType: 'scheduled' for scheduled invoices, 'unpaid' for create/create_and_send.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the draft invoice",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the invoice was created (ISO 8601)",
                      "example": "2024-06-01T07:00:00.000Z"
                    },
                    "pdfUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Direct URL to download the invoice PDF",
                      "example": "https://eigenn.io/api/download/invoice?token=eyJ..."
                    },
                    "previewUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Direct URL to preview the invoice in browser",
                      "example": "https://eigenn.io/i/eyJ..."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "overdue",
                        "paid",
                        "unpaid",
                        "canceled",
                        "scheduled"
                      ],
                      "description": "Current status of the invoice",
                      "example": "draft"
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Timestamp when the invoice was last updated (ISO 8601)",
                      "example": "2024-06-01T07:00:00.000Z"
                    }
                  },
                  "required": [
                    "id",
                    "createdAt",
                    "pdfUrl",
                    "previewUrl",
                    "status",
                    "updatedAt"
                  ],
                  "description": "Response after creating a draft invoice"
                },
                "examples": {
                  "created": {
                    "summary": "Invoice created and marked unpaid",
                    "value": {
                      "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                      "createdAt": "2024-06-15T08:00:00.000Z",
                      "pdfUrl": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390",
                      "previewUrl": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390",
                      "status": "unpaid",
                      "updatedAt": "2024-06-15T08:00:00.000Z"
                    }
                  },
                  "scheduled": {
                    "summary": "Invoice scheduled for later delivery",
                    "value": {
                      "id": "c3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                      "createdAt": "2024-06-15T08:00:00.000Z",
                      "pdfUrl": null,
                      "previewUrl": null,
                      "status": "scheduled",
                      "updatedAt": "2024-06-15T08:05:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input data or validation errors.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message describing the validation failure",
                      "examples": [
                        "scheduledAt is required for scheduled delivery",
                        "scheduledAt must be in the future",
                        "Invoice number 'INV-001' is already used. Please provide a different invoice number or omit it to auto-generate one."
                      ]
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "examples": {
                  "missingScheduledAt": {
                    "summary": "Scheduled delivery missing scheduledAt",
                    "value": {
                      "message": "scheduledAt is required for scheduled delivery"
                    }
                  },
                  "scheduledAtInPast": {
                    "summary": "Scheduled delivery with past scheduledAt",
                    "value": {
                      "message": "scheduledAt must be in the future"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Customer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message",
                      "example": "Customer not found"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Customer not found"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. Invoice number already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message about the conflict",
                      "example": "Invoice number 'INV-2024-001' is already used. Please provide a different invoice number or omit it to auto-generate one."
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Invoice number 'INV-2024-001' is already used. Please provide a different invoice number or omit it to auto-generate one."
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message",
                      "example": "Failed to create invoice"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Failed to create invoice"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/invoices/payment-status": {
      "get": {
        "description": "Get payment status health score for the authenticated team. Returns a 0–100 composite score and a qualitative paymentStatus label (good, fair, poor) based on the ratio of paid versus outstanding invoices. Useful for dashboard health indicators.\n\nRequired scopes: invoices.read",
        "operationId": "getInvoicePaymentStatus",
        "summary": "Payment status",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "paymentStatus",
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Payment status for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "paymentStatus": {
                      "type": "string",
                      "description": "The payment status of the invoice",
                      "example": "good"
                    },
                    "score": {
                      "type": "number",
                      "description": "Score associated with the invoice payment status",
                      "example": 85
                    }
                  },
                  "required": [
                    "paymentStatus",
                    "score"
                  ]
                },
                "example": {
                  "paymentStatus": "good",
                  "score": 85
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/summary": {
      "get": {
        "description": "Get aggregate invoice totals for the authenticated team, optionally filtered by status. Returns total amount, invoice count, and a currency-level breakdown showing original and converted amounts for multi-currency invoices.\n\nRequired scopes: invoices.read",
        "operationId": "getInvoiceSummary",
        "summary": "Invoice summary",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "summary",
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "draft",
                  "overdue",
                  "paid",
                  "unpaid",
                  "canceled",
                  "scheduled"
                ]
              },
              "description": "Filter summary by invoice statuses",
              "example": [
                "draft",
                "unpaid"
              ]
            },
            "required": false,
            "description": "Filter summary by invoice statuses",
            "in": "query",
            "name": "statuses"
          }
        ],
        "responses": {
          "200": {
            "description": "Summary of invoices for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "breakdown": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "convertedAmount": {
                            "type": "number",
                            "description": "Amount converted to the team's base currency",
                            "example": 16250.75
                          },
                          "count": {
                            "type": "number",
                            "description": "Number of invoices in this currency",
                            "example": 5
                          },
                          "currency": {
                            "type": "string",
                            "description": "Original currency of the invoices",
                            "example": "EUR"
                          },
                          "originalAmount": {
                            "type": "number",
                            "description": "Total amount in the original currency",
                            "example": 15000.5
                          }
                        },
                        "required": [
                          "convertedAmount",
                          "count",
                          "currency",
                          "originalAmount"
                        ]
                      },
                      "description": "Currency breakdown when multiple currencies are included in the total",
                      "example": [
                        {
                          "convertedAmount": 16250.75,
                          "count": 5,
                          "currency": "EUR",
                          "originalAmount": 15000.5
                        },
                        {
                          "convertedAmount": 9200.5,
                          "count": 3,
                          "currency": "GBP",
                          "originalAmount": 8000.25
                        }
                      ]
                    },
                    "currency": {
                      "type": "string",
                      "description": "Base currency of the team",
                      "example": "USD"
                    },
                    "invoiceCount": {
                      "type": "number",
                      "description": "Total number of invoices",
                      "example": 15
                    },
                    "totalAmount": {
                      "type": "number",
                      "description": "Total amount of all invoices converted to the team's base currency",
                      "example": 224171.25
                    }
                  },
                  "required": [
                    "currency",
                    "invoiceCount",
                    "totalAmount"
                  ],
                  "description": "Invoice summary containing totals converted to the team's base currency and optional currency breakdown.",
                  "example": {
                    "breakdown": [
                      {
                        "convertedAmount": 16250.75,
                        "count": 5,
                        "currency": "EUR",
                        "originalAmount": 15000.5
                      },
                      {
                        "convertedAmount": 9200.5,
                        "count": 3,
                        "currency": "GBP",
                        "originalAmount": 8000.25
                      }
                    ],
                    "currency": "USD",
                    "invoiceCount": 15,
                    "totalAmount": 224171.25
                  }
                },
                "example": {
                  "breakdown": [
                    {
                      "convertedAmount": 16250.75,
                      "count": 5,
                      "currency": "EUR",
                      "originalAmount": 15000.5
                    },
                    {
                      "convertedAmount": 9200.5,
                      "count": 3,
                      "currency": "GBP",
                      "originalAmount": 8000.25
                    }
                  ],
                  "currency": "USD",
                  "invoiceCount": 15,
                  "totalAmount": 224171.25
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoices/{id}": {
      "get": {
        "description": "Retrieve a single invoice by its UUID. Returns the full invoice record including line items, template configuration, customer details, calculated totals, and PDF/preview URLs. Optionally include recurring schedule data via the includeRecurring query parameter. Returns 404 if the invoice is not found.\n\nRequired scopes: invoices.read",
        "operationId": "getInvoiceById",
        "summary": "Retrieve an invoice",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "get",
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "in": "path",
            "name": "id"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Include recurring series metadata for this invoice.",
              "example": true
            },
            "required": false,
            "description": "Include recurring series metadata for this invoice.",
            "in": "query",
            "name": "includeRecurring"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve an invoice by its unique identifier for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the invoice",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Total amount of the invoice",
                      "example": 1500.75
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the invoice was created (ISO 8601)",
                      "example": "2024-06-01T07:00:00.000Z"
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency code (ISO 4217) for the invoice amount",
                      "example": "USD"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier for the customer",
                          "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "email",
                          "description": "Email address of the customer",
                          "example": "info@acme.com"
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the customer",
                          "example": "Acme Corporation"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Website URL of the customer",
                          "example": "https://acme.com"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "website"
                      ],
                      "description": "Customer details"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the customer as shown on the invoice, or null if not set",
                      "example": "Acme Corporation"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount applied to the invoice, or null if none",
                      "example": 50
                    },
                    "dueDate": {
                      "type": "string",
                      "description": "Due date of the invoice in ISO 8601 format",
                      "example": "2024-06-30T23:59:59.000Z"
                    },
                    "invoiceNumber": {
                      "type": "string",
                      "description": "Invoice number as shown to the customer (auto-generated if not provided)",
                      "example": "INV-2024-001"
                    },
                    "invoiceRecurringId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Recurring series ID if this invoice is part of a series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "issueDate": {
                      "type": "string",
                      "description": "Issue date of the invoice in ISO 8601 format",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional note attached to the invoice",
                      "example": "Thank you for your business."
                    },
                    "paidAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when the invoice was paid (ISO 8601), or null if unpaid",
                      "example": "2024-06-15T12:00:00.000Z"
                    },
                    "pdfUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to download the invoice PDF, or null if not generated",
                      "example": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390"
                    },
                    "previewUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to preview the invoice in the browser, or null if not generated",
                      "example": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390"
                    },
                    "recurring": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "endCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total invoices to generate (if endType is 'after_count')",
                          "example": 12
                        },
                        "endDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "End date for the series (if endType is 'on_date')",
                          "example": null
                        },
                        "endType": {
                          "type": "string",
                          "enum": [
                            "never",
                            "on_date",
                            "after_count"
                          ],
                          "description": "How the recurring series ends",
                          "example": "after_count"
                        },
                        "frequency": {
                          "type": "string",
                          "enum": [
                            "weekly",
                            "biweekly",
                            "monthly_date",
                            "monthly_weekday",
                            "monthly_last_day",
                            "quarterly",
                            "semi_annual",
                            "annual",
                            "custom"
                          ],
                          "description": "Frequency of the series",
                          "example": "monthly_date"
                        },
                        "frequencyDay": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Day parameter for frequency",
                          "example": 15
                        },
                        "frequencyInterval": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Interval for custom frequency (days between invoices)",
                          "example": null
                        },
                        "frequencyWeek": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Week parameter for monthly_weekday frequency",
                          "example": null
                        },
                        "invoicesGenerated": {
                          "type": "number",
                          "description": "Number of invoices generated so far",
                          "example": 3
                        },
                        "nextScheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Next scheduled invoice date",
                          "example": "2026-02-15T00:00:00.000Z"
                        },
                        "recurringId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "ID of the recurring invoice series",
                          "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                        },
                        "sequence": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Sequence number of this invoice in the series (e.g., 3 for 3rd invoice)",
                          "example": 3
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "paused",
                            "completed",
                            "canceled"
                          ],
                          "description": "Status of the recurring series",
                          "example": "active"
                        },
                        "totalCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total count if series has a limit (null if no end)",
                          "example": 12
                        }
                      },
                      "required": [
                        "endCount",
                        "endDate",
                        "endType",
                        "frequency",
                        "frequencyDay",
                        "frequencyInterval",
                        "frequencyWeek",
                        "invoicesGenerated",
                        "nextScheduledAt",
                        "recurringId",
                        "status"
                      ],
                      "description": "Recurring series metadata for this invoice"
                    },
                    "recurringSequence": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Sequence number of this invoice in the recurring series",
                      "example": 3
                    },
                    "reminderSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when a payment reminder was sent (ISO 8601), or null if never sent",
                      "example": "2024-06-10T09:00:00.000Z"
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when the invoice was sent (ISO 8601), or null if not sent",
                      "example": "2024-06-02T08:00:00.000Z"
                    },
                    "sentTo": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "email",
                      "description": "Email address to which the invoice was sent, or null if not sent",
                      "example": "billing@acme.com"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "overdue",
                        "paid",
                        "unpaid",
                        "canceled",
                        "scheduled"
                      ],
                      "description": "Current status of the invoice",
                      "example": "paid"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal before taxes and discounts, or null if not calculated",
                      "example": 1400
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount, or null if not applicable",
                      "example": 80
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Timestamp when the invoice was last updated (ISO 8601)",
                      "example": "2024-06-15T10:00:00.000Z"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Value-added tax amount, or null if not applicable",
                      "example": 120
                    },
                    "viewedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when the invoice was viewed by the customer (ISO 8601), or null if never viewed",
                      "example": "2024-06-05T14:30:00.000Z"
                    }
                  },
                  "required": [
                    "id",
                    "amount",
                    "createdAt",
                    "currency",
                    "customer",
                    "customerName",
                    "discount",
                    "dueDate",
                    "issueDate",
                    "note",
                    "paidAt",
                    "pdfUrl",
                    "previewUrl",
                    "reminderSentAt",
                    "sentAt",
                    "sentTo",
                    "status",
                    "subtotal",
                    "tax",
                    "updatedAt",
                    "vat",
                    "viewedAt"
                  ],
                  "description": "Invoice object"
                },
                "example": {
                  "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                  "amount": 1085,
                  "createdAt": "2024-06-01T07:00:00.000Z",
                  "currency": "USD",
                  "customer": {
                    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "email": "billing@acme.com",
                    "name": "Acme Corporation",
                    "website": "https://acme.com"
                  },
                  "customerName": "Acme Corporation",
                  "discount": 0,
                  "dueDate": "2024-06-30T23:59:59.000Z",
                  "invoiceNumber": "INV-2024-001",
                  "issueDate": "2024-06-01T00:00:00.000Z",
                  "note": "Payment due within 30 days.",
                  "paidAt": null,
                  "pdfUrl": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390",
                  "previewUrl": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390",
                  "reminderSentAt": "2024-06-10T09:00:00.000Z",
                  "sentAt": "2024-06-02T08:00:00.000Z",
                  "sentTo": "billing@acme.com",
                  "status": "unpaid",
                  "subtotal": 1000,
                  "tax": 85,
                  "updatedAt": "2024-06-15T10:00:00.000Z",
                  "vat": null,
                  "viewedAt": "2024-06-05T14:30:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "description": "Update an invoice's status and metadata by its UUID. Supports changing status, setting paidAt, and adding internal notes. The invoice must belong to the authenticated team. Returns the full updated invoice including recalculated URLs. Returns 404 if not found.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "updateInvoice",
        "summary": "Update an invoice",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "update",
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "description": "Update invoice status metadata such as payment or internal notes.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "internalNote": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Internal note for the invoice",
                    "example": "Payment received via bank transfer"
                  },
                  "paidAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Timestamp when the invoice was paid (ISO 8601)",
                    "example": "2024-06-15T12:00:00.000Z"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "paid",
                      "canceled",
                      "unpaid",
                      "scheduled",
                      "draft"
                    ],
                    "description": "New status for the invoice",
                    "example": "paid"
                  }
                },
                "description": "Schema for updating an invoice"
              },
              "example": {
                "internalNote": "Payment received via bank transfer.",
                "paidAt": "2024-06-15T12:00:00.000Z",
                "status": "paid"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invoice updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the invoice",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "amount": {
                      "type": "number",
                      "description": "Total amount of the invoice",
                      "example": 1500.75
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Timestamp when the invoice was created (ISO 8601)",
                      "example": "2024-06-01T07:00:00.000Z"
                    },
                    "currency": {
                      "type": "string",
                      "description": "Currency code (ISO 4217) for the invoice amount",
                      "example": "USD"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier for the customer",
                          "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "email",
                          "description": "Email address of the customer",
                          "example": "info@acme.com"
                        },
                        "name": {
                          "type": "string",
                          "description": "Name of the customer",
                          "example": "Acme Corporation"
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Website URL of the customer",
                          "example": "https://acme.com"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "website"
                      ],
                      "description": "Customer details"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Name of the customer as shown on the invoice, or null if not set",
                      "example": "Acme Corporation"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount applied to the invoice, or null if none",
                      "example": 50
                    },
                    "dueDate": {
                      "type": "string",
                      "description": "Due date of the invoice in ISO 8601 format",
                      "example": "2024-06-30T23:59:59.000Z"
                    },
                    "invoiceNumber": {
                      "type": "string",
                      "description": "Invoice number as shown to the customer (auto-generated if not provided)",
                      "example": "INV-2024-001"
                    },
                    "invoiceRecurringId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Recurring series ID if this invoice is part of a series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "issueDate": {
                      "type": "string",
                      "description": "Issue date of the invoice in ISO 8601 format",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Optional note attached to the invoice",
                      "example": "Thank you for your business."
                    },
                    "paidAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when the invoice was paid (ISO 8601), or null if unpaid",
                      "example": "2024-06-15T12:00:00.000Z"
                    },
                    "pdfUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to download the invoice PDF, or null if not generated",
                      "example": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390"
                    },
                    "previewUrl": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "URL to preview the invoice in the browser, or null if not generated",
                      "example": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390"
                    },
                    "recurring": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "endCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total invoices to generate (if endType is 'after_count')",
                          "example": 12
                        },
                        "endDate": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "End date for the series (if endType is 'on_date')",
                          "example": null
                        },
                        "endType": {
                          "type": "string",
                          "enum": [
                            "never",
                            "on_date",
                            "after_count"
                          ],
                          "description": "How the recurring series ends",
                          "example": "after_count"
                        },
                        "frequency": {
                          "type": "string",
                          "enum": [
                            "weekly",
                            "biweekly",
                            "monthly_date",
                            "monthly_weekday",
                            "monthly_last_day",
                            "quarterly",
                            "semi_annual",
                            "annual",
                            "custom"
                          ],
                          "description": "Frequency of the series",
                          "example": "monthly_date"
                        },
                        "frequencyDay": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Day parameter for frequency",
                          "example": 15
                        },
                        "frequencyInterval": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Interval for custom frequency (days between invoices)",
                          "example": null
                        },
                        "frequencyWeek": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Week parameter for monthly_weekday frequency",
                          "example": null
                        },
                        "invoicesGenerated": {
                          "type": "number",
                          "description": "Number of invoices generated so far",
                          "example": 3
                        },
                        "nextScheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Next scheduled invoice date",
                          "example": "2026-02-15T00:00:00.000Z"
                        },
                        "recurringId": {
                          "type": "string",
                          "format": "uuid",
                          "description": "ID of the recurring invoice series",
                          "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                        },
                        "sequence": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Sequence number of this invoice in the series (e.g., 3 for 3rd invoice)",
                          "example": 3
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "paused",
                            "completed",
                            "canceled"
                          ],
                          "description": "Status of the recurring series",
                          "example": "active"
                        },
                        "totalCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total count if series has a limit (null if no end)",
                          "example": 12
                        }
                      },
                      "required": [
                        "endCount",
                        "endDate",
                        "endType",
                        "frequency",
                        "frequencyDay",
                        "frequencyInterval",
                        "frequencyWeek",
                        "invoicesGenerated",
                        "nextScheduledAt",
                        "recurringId",
                        "status"
                      ],
                      "description": "Recurring series metadata for this invoice"
                    },
                    "recurringSequence": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Sequence number of this invoice in the recurring series",
                      "example": 3
                    },
                    "reminderSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when a payment reminder was sent (ISO 8601), or null if never sent",
                      "example": "2024-06-10T09:00:00.000Z"
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when the invoice was sent (ISO 8601), or null if not sent",
                      "example": "2024-06-02T08:00:00.000Z"
                    },
                    "sentTo": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "email",
                      "description": "Email address to which the invoice was sent, or null if not sent",
                      "example": "billing@acme.com"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "overdue",
                        "paid",
                        "unpaid",
                        "canceled",
                        "scheduled"
                      ],
                      "description": "Current status of the invoice",
                      "example": "paid"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal before taxes and discounts, or null if not calculated",
                      "example": 1400
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount, or null if not applicable",
                      "example": 80
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "Timestamp when the invoice was last updated (ISO 8601)",
                      "example": "2024-06-15T10:00:00.000Z"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Value-added tax amount, or null if not applicable",
                      "example": 120
                    },
                    "viewedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Timestamp when the invoice was viewed by the customer (ISO 8601), or null if never viewed",
                      "example": "2024-06-05T14:30:00.000Z"
                    }
                  },
                  "required": [
                    "id",
                    "amount",
                    "createdAt",
                    "currency",
                    "customer",
                    "customerName",
                    "discount",
                    "dueDate",
                    "issueDate",
                    "note",
                    "paidAt",
                    "pdfUrl",
                    "previewUrl",
                    "reminderSentAt",
                    "sentAt",
                    "sentTo",
                    "status",
                    "subtotal",
                    "tax",
                    "updatedAt",
                    "vat",
                    "viewedAt"
                  ],
                  "description": "Response after updating an invoice"
                },
                "example": {
                  "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                  "amount": 1085,
                  "createdAt": "2024-06-01T07:00:00.000Z",
                  "currency": "USD",
                  "customer": {
                    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "email": "billing@acme.com",
                    "name": "Acme Corporation",
                    "website": "https://acme.com"
                  },
                  "customerName": "Acme Corporation",
                  "discount": 0,
                  "dueDate": "2024-06-30T23:59:59.000Z",
                  "invoiceNumber": "INV-2024-001",
                  "issueDate": "2024-06-01T00:00:00.000Z",
                  "note": "Payment due within 30 days.",
                  "paidAt": "2024-06-15T12:00:00.000Z",
                  "pdfUrl": "https://eigenn.io/api/download/invoice?token=eef58951-1682-4062-b010-425866032390",
                  "previewUrl": "https://eigenn.io/i/eef58951-1682-4062-b010-425866032390",
                  "reminderSentAt": "2024-06-10T09:00:00.000Z",
                  "sentAt": "2024-06-02T08:00:00.000Z",
                  "sentTo": "billing@acme.com",
                  "status": "paid",
                  "subtotal": 1000,
                  "tax": 85,
                  "updatedAt": "2024-06-15T12:05:00.000Z",
                  "vat": null,
                  "viewedAt": "2024-06-05T14:30:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message",
                      "example": "Invoice not found"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Invoice not found"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Delete an invoice by its UUID. Only invoices with status 'draft' or 'canceled' can be deleted — returns 400 for invoices in other statuses. To delete a non-draft invoice, first update its status to 'canceled' via the update endpoint. Returns 404 if the invoice is not found.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "deleteInvoice",
        "summary": "Delete an invoice",
        "tags": [
          "Invoices"
        ],
        "x-speakeasy-name-override": "delete",
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete an invoice by its unique identifier for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the deleted invoice",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    }
                  },
                  "required": [
                    "id"
                  ]
                },
                "example": {
                  "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                }
              }
            }
          },
          "400": {
            "description": "Invoice cannot be deleted in its current status. Only draft or canceled invoices are deletable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message",
                      "example": "Cannot delete invoice with status 'unpaid'. Only draft or canceled invoices can be deleted."
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Cannot delete invoice with status 'unpaid'. Only draft or canceled invoices can be deleted."
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Invoice not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message",
                      "example": "Invoice not found"
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "example": {
                  "message": "Invoice not found"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-recurring": {
      "get": {
        "summary": "List recurring invoice series",
        "operationId": "listInvoiceRecurring",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a paginated list of recurring invoice series for the authenticated team. Supports filtering by status (active, paused, canceled, completed) and customer ID. Each series defines the frequency, end conditions, and template for auto-generated invoices.\n\nRequired scopes: invoices.read",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Cursor for pagination"
            },
            "required": false,
            "description": "Cursor for pagination",
            "in": "query",
            "name": "cursor"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "default": 25,
              "description": "Number of items per page (1-100)"
            },
            "required": false,
            "description": "Number of items per page (1-100)",
            "in": "query",
            "name": "pageSize"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string",
                "enum": [
                  "active",
                  "paused",
                  "completed",
                  "canceled"
                ]
              },
              "description": "Filter by status"
            },
            "required": false,
            "description": "Filter by status",
            "in": "query",
            "name": "status"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid",
              "description": "Filter by customer ID"
            },
            "required": false,
            "description": "Filter by customer ID",
            "in": "query",
            "name": "customerId"
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring invoice series list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for next page, null if no more pages",
                          "example": "25"
                        },
                        "hasPreviousPage": {
                          "type": "boolean",
                          "description": "Whether there is a previous page",
                          "example": false
                        },
                        "hasNextPage": {
                          "type": "boolean",
                          "description": "Whether there is a next page",
                          "example": true
                        }
                      },
                      "required": [
                        "cursor",
                        "hasPreviousPage",
                        "hasNextPage"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier for the recurring invoice series",
                            "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "When the series was created (ISO 8601)",
                            "example": "2024-06-01T00:00:00.000Z"
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the series was last updated (ISO 8601)",
                            "example": "2024-06-15T00:00:00.000Z"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "paused",
                              "completed",
                              "canceled"
                            ],
                            "description": "Current status of the recurring series",
                            "example": "active"
                          },
                          "frequency": {
                            "type": "string",
                            "enum": [
                              "weekly",
                              "biweekly",
                              "monthly_date",
                              "monthly_weekday",
                              "monthly_last_day",
                              "quarterly",
                              "semi_annual",
                              "annual",
                              "custom"
                            ],
                            "description": "Frequency of invoice generation",
                            "example": "monthly_date"
                          },
                          "frequencyDay": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Day parameter for frequency",
                            "example": 15
                          },
                          "frequencyWeek": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Week parameter for monthly_weekday frequency",
                            "example": null
                          },
                          "frequencyInterval": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Interval for custom frequency",
                            "example": null
                          },
                          "endType": {
                            "type": "string",
                            "enum": [
                              "never",
                              "on_date",
                              "after_count"
                            ],
                            "description": "How the series ends",
                            "example": "after_count"
                          },
                          "endDate": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "End date (if endType is 'on_date')",
                            "example": null
                          },
                          "endCount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "End count (if endType is 'after_count')",
                            "example": 12
                          },
                          "invoicesGenerated": {
                            "type": "number",
                            "description": "Number of invoices generated so far",
                            "example": 3
                          },
                          "consecutiveFailures": {
                            "type": "number",
                            "description": "Number of consecutive failures",
                            "example": 0
                          },
                          "nextScheduledAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Next scheduled generation date (ISO 8601)",
                            "example": "2026-02-15T00:00:00.000Z"
                          },
                          "amount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Invoice amount",
                            "example": 1500
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Currency code",
                            "example": "USD"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid",
                            "description": "Customer ID",
                            "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                          },
                          "customerName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Customer name",
                            "example": "Acme Corporation"
                          },
                          "upcomingNotificationSentAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the upcoming notification was last sent (ISO 8601)",
                            "example": "2026-02-01T12:00:00.000Z"
                          },
                          "customer": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "name": {
                                "type": "string"
                              },
                              "email": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "website": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "email"
                            ],
                            "description": "Customer details"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "updatedAt",
                          "status",
                          "frequency",
                          "frequencyDay",
                          "frequencyWeek",
                          "frequencyInterval",
                          "endType",
                          "endDate",
                          "endCount",
                          "invoicesGenerated",
                          "consecutiveFailures",
                          "nextScheduledAt",
                          "amount",
                          "currency",
                          "customerId",
                          "customerName",
                          "upcomingNotificationSentAt",
                          "customer"
                        ]
                      },
                      "description": "List of recurring invoice series"
                    }
                  },
                  "required": [
                    "meta",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create recurring invoice series",
        "operationId": "createInvoiceRecurring",
        "x-speakeasy-name-override": "create",
        "description": "Create a new recurring invoice series. Define the frequency (weekly, monthly, quarterly, etc.), customer, line items, and end conditions (never, after N invoices, or on a date). Optionally link an existing invoice as the first in the series. If the linked invoice's issue date is in the past, the next scheduled date is calculated immediately. The customer must have an email address.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "invoiceId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional draft invoice ID to convert to the first recurring invoice",
                    "example": "d1e2f3a4-b5c6-7890-abcd-ef1234567890"
                  },
                  "customerId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Customer ID for the recurring invoice series (required - recurring invoices auto-send)",
                    "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  },
                  "customerName": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Customer name for display",
                    "example": "Acme Corporation"
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "weekly",
                      "biweekly",
                      "monthly_date",
                      "monthly_weekday",
                      "monthly_last_day",
                      "quarterly",
                      "semi_annual",
                      "annual",
                      "custom"
                    ],
                    "description": "How often invoices should be generated: 'weekly' - every week on a specific day, 'biweekly' - every 2 weeks on a specific day, 'monthly_date' - monthly on a specific date (e.g., 15th), 'monthly_weekday' - monthly on a specific weekday occurrence (e.g., 1st Friday), 'monthly_last_day' - monthly on the last day, 'quarterly' - every 3 months, 'semi_annual' - every 6 months, 'annual' - every 12 months, 'custom' - every X days",
                    "example": "monthly_date"
                  },
                  "frequencyDay": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 31,
                    "description": "For 'weekly': day of week (0=Sunday, 6=Saturday). For 'monthly_date': day of month (1-31). For 'monthly_weekday': day of week (0=Sunday, 6=Saturday)",
                    "example": 15
                  },
                  "frequencyWeek": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 5,
                    "description": "For 'monthly_weekday': which occurrence of the weekday (1=first, 2=second, etc.)",
                    "example": 1
                  },
                  "frequencyInterval": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "For 'custom': number of days between invoices",
                    "example": 14
                  },
                  "endType": {
                    "type": "string",
                    "enum": [
                      "never",
                      "on_date",
                      "after_count"
                    ],
                    "description": "When the series should end: 'never' - continues indefinitely, 'on_date' - ends on a specific date, 'after_count' - ends after a specific number of invoices",
                    "example": "after_count"
                  },
                  "endDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "End date for the series (required if endType is 'on_date')",
                    "example": "2025-12-31T23:59:59.000Z"
                  },
                  "endCount": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "Number of invoices to generate (required if endType is 'after_count')",
                    "example": 12
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Timezone for scheduling (e.g., 'America/New_York'). Must be a valid IANA timezone identifier.",
                    "example": "America/New_York"
                  },
                  "dueDateOffset": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 30,
                    "description": "Days from issue date to due date",
                    "example": 30
                  },
                  "amount": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Total amount for each invoice",
                    "example": 1500
                  },
                  "currency": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Currency code (ISO 4217)",
                    "example": "USD"
                  },
                  "lineItems": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "type": "number"
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0
                        },
                        "tax": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "taxRate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 100
                        },
                        "unit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "vat": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "productId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "tax2": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "taxPresetId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        }
                      }
                    },
                    "description": "Line items for the invoice"
                  },
                  "template": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "currency": {
                        "type": "string"
                      },
                      "customerLabel": {
                        "type": "string"
                      },
                      "dateFormat": {
                        "type": "string"
                      },
                      "deliveryType": {
                        "type": "string",
                        "enum": [
                          "create",
                          "create_and_send",
                          "scheduled"
                        ]
                      },
                      "descriptionLabel": {
                        "type": "string"
                      },
                      "discountLabel": {
                        "type": "string"
                      },
                      "dueDateLabel": {
                        "type": "string"
                      },
                      "fromLabel": {
                        "type": "string"
                      },
                      "includeDecimals": {
                        "type": "boolean"
                      },
                      "includeDiscount": {
                        "type": "boolean"
                      },
                      "includeLineItemTax": {
                        "type": "boolean"
                      },
                      "includePdf": {
                        "type": "boolean"
                      },
                      "includeQr": {
                        "type": "boolean"
                      },
                      "includeTax": {
                        "type": "boolean"
                      },
                      "includeUnits": {
                        "type": "boolean"
                      },
                      "includeVat": {
                        "type": "boolean"
                      },
                      "invoiceNoLabel": {
                        "type": "string"
                      },
                      "issueDateLabel": {
                        "type": "string"
                      },
                      "lineItemTaxLabel": {
                        "type": "string"
                      },
                      "locale": {
                        "type": "string"
                      },
                      "logoUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "noteLabel": {
                        "type": "string"
                      },
                      "paymentEnabled": {
                        "type": "boolean"
                      },
                      "paymentLabel": {
                        "type": "string"
                      },
                      "paymentTermsDays": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "priceLabel": {
                        "type": "string"
                      },
                      "quantityLabel": {
                        "type": "string"
                      },
                      "sendCopy": {
                        "type": "boolean"
                      },
                      "size": {
                        "type": "string",
                        "enum": [
                          "a4",
                          "letter"
                        ]
                      },
                      "subtotalLabel": {
                        "type": "string"
                      },
                      "taxLabel": {
                        "type": "string"
                      },
                      "taxRate": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                      },
                      "timezone": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "totalLabel": {
                        "type": "string"
                      },
                      "totalSummaryLabel": {
                        "type": "string"
                      },
                      "vatLabel": {
                        "type": "string"
                      },
                      "vatRate": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "isDefault": {
                        "type": "boolean"
                      },
                      "fromDetails": {},
                      "noteDetails": {},
                      "paymentDetails": {}
                    },
                    "description": "Invoice template settings"
                  },
                  "paymentDetails": {
                    "description": "Payment details in TipTap JSONContent format"
                  },
                  "fromDetails": {
                    "description": "Sender details in TipTap JSONContent format"
                  },
                  "noteDetails": {
                    "description": "Note details in TipTap JSONContent format"
                  },
                  "vat": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "VAT amount",
                    "example": 150
                  },
                  "tax": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Tax amount",
                    "example": 50
                  },
                  "discount": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Discount amount",
                    "example": 100
                  },
                  "subtotal": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Subtotal before taxes and discounts",
                    "example": 1400
                  },
                  "topBlock": {
                    "description": "Custom content block for top of invoice"
                  },
                  "bottomBlock": {
                    "description": "Custom content block for bottom of invoice"
                  },
                  "templateId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Reference to invoice template",
                    "example": "c4d5e6f7-8901-2345-6789-abcdef012345"
                  }
                },
                "required": [
                  "customerId",
                  "frequency",
                  "endType",
                  "timezone"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Recurring invoice series created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the recurring invoice series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the series was created (ISO 8601)",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the series was last updated (ISO 8601)",
                      "example": "2024-06-15T00:00:00.000Z"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused",
                        "completed",
                        "canceled"
                      ],
                      "description": "Current status of the recurring series",
                      "example": "active"
                    },
                    "frequency": {
                      "type": "string",
                      "enum": [
                        "weekly",
                        "biweekly",
                        "monthly_date",
                        "monthly_weekday",
                        "monthly_last_day",
                        "quarterly",
                        "semi_annual",
                        "annual",
                        "custom"
                      ],
                      "description": "Frequency of invoice generation",
                      "example": "monthly_date"
                    },
                    "frequencyDay": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Day parameter for frequency",
                      "example": 15
                    },
                    "frequencyWeek": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Week parameter for monthly_weekday frequency",
                      "example": null
                    },
                    "frequencyInterval": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Interval for custom frequency",
                      "example": null
                    },
                    "endType": {
                      "type": "string",
                      "enum": [
                        "never",
                        "on_date",
                        "after_count"
                      ],
                      "description": "How the series ends",
                      "example": "after_count"
                    },
                    "endDate": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "End date (if endType is 'on_date')",
                      "example": null
                    },
                    "endCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "End count (if endType is 'after_count')",
                      "example": 12
                    },
                    "invoicesGenerated": {
                      "type": "number",
                      "description": "Number of invoices generated so far",
                      "example": 3
                    },
                    "consecutiveFailures": {
                      "type": "number",
                      "description": "Number of consecutive failures",
                      "example": 0
                    },
                    "nextScheduledAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Next scheduled generation date (ISO 8601)",
                      "example": "2026-02-15T00:00:00.000Z"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Invoice amount",
                      "example": 1500
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code",
                      "example": "USD"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Customer ID",
                      "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Customer name",
                      "example": "Acme Corporation"
                    },
                    "upcomingNotificationSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the upcoming notification was last sent (ISO 8601)",
                      "example": "2026-02-01T12:00:00.000Z"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email"
                      ],
                      "description": "Customer details"
                    },
                    "teamId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Team ID for the recurring series"
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "User who created the recurring series"
                    },
                    "lastGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the last invoice was generated (ISO 8601)",
                      "example": "2026-01-15T00:00:00.000Z"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone used for scheduling",
                      "example": "UTC"
                    },
                    "dueDateOffset": {
                      "type": "number",
                      "description": "Days from issue date to due date",
                      "example": 30
                    },
                    "lineItems": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {},
                      "description": "Line items stored on the recurring series"
                    },
                    "template": {
                      "description": "Template settings stored on the recurring series"
                    },
                    "paymentDetails": {
                      "description": "Payment details (TipTap JSON)"
                    },
                    "fromDetails": {
                      "description": "From details (TipTap JSON)"
                    },
                    "noteDetails": {
                      "description": "Note details (TipTap JSON)"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "VAT amount"
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal amount"
                    },
                    "topBlock": {
                      "description": "Top content block (TipTap JSON)"
                    },
                    "bottomBlock": {
                      "description": "Bottom content block (TipTap JSON)"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Associated template ID"
                    }
                  },
                  "required": [
                    "id",
                    "createdAt",
                    "updatedAt",
                    "status",
                    "frequency",
                    "frequencyDay",
                    "frequencyWeek",
                    "frequencyInterval",
                    "endType",
                    "endDate",
                    "endCount",
                    "invoicesGenerated",
                    "consecutiveFailures",
                    "nextScheduledAt",
                    "amount",
                    "currency",
                    "customerId",
                    "customerName",
                    "upcomingNotificationSentAt",
                    "customer",
                    "teamId",
                    "userId",
                    "lastGeneratedAt",
                    "timezone",
                    "dueDateOffset"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/invoice-recurring/{id}": {
      "get": {
        "summary": "Get recurring invoice series",
        "operationId": "getInvoiceRecurring",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single recurring invoice series by its UUID. Returns the full configuration including frequency, customer, line items, generation history, and next scheduled date. Returns 404 if the series does not exist or belongs to a different team.\n\nRequired scopes: invoices.read",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for the recurring invoice series",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier for the recurring invoice series",
            "in": "path",
            "name": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring invoice series",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the recurring invoice series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the series was created (ISO 8601)",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the series was last updated (ISO 8601)",
                      "example": "2024-06-15T00:00:00.000Z"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused",
                        "completed",
                        "canceled"
                      ],
                      "description": "Current status of the recurring series",
                      "example": "active"
                    },
                    "frequency": {
                      "type": "string",
                      "enum": [
                        "weekly",
                        "biweekly",
                        "monthly_date",
                        "monthly_weekday",
                        "monthly_last_day",
                        "quarterly",
                        "semi_annual",
                        "annual",
                        "custom"
                      ],
                      "description": "Frequency of invoice generation",
                      "example": "monthly_date"
                    },
                    "frequencyDay": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Day parameter for frequency",
                      "example": 15
                    },
                    "frequencyWeek": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Week parameter for monthly_weekday frequency",
                      "example": null
                    },
                    "frequencyInterval": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Interval for custom frequency",
                      "example": null
                    },
                    "endType": {
                      "type": "string",
                      "enum": [
                        "never",
                        "on_date",
                        "after_count"
                      ],
                      "description": "How the series ends",
                      "example": "after_count"
                    },
                    "endDate": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "End date (if endType is 'on_date')",
                      "example": null
                    },
                    "endCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "End count (if endType is 'after_count')",
                      "example": 12
                    },
                    "invoicesGenerated": {
                      "type": "number",
                      "description": "Number of invoices generated so far",
                      "example": 3
                    },
                    "consecutiveFailures": {
                      "type": "number",
                      "description": "Number of consecutive failures",
                      "example": 0
                    },
                    "nextScheduledAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Next scheduled generation date (ISO 8601)",
                      "example": "2026-02-15T00:00:00.000Z"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Invoice amount",
                      "example": 1500
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code",
                      "example": "USD"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Customer ID",
                      "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Customer name",
                      "example": "Acme Corporation"
                    },
                    "upcomingNotificationSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the upcoming notification was last sent (ISO 8601)",
                      "example": "2026-02-01T12:00:00.000Z"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email"
                      ],
                      "description": "Customer details"
                    },
                    "teamId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Team ID for the recurring series"
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "User who created the recurring series"
                    },
                    "lastGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the last invoice was generated (ISO 8601)",
                      "example": "2026-01-15T00:00:00.000Z"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone used for scheduling",
                      "example": "UTC"
                    },
                    "dueDateOffset": {
                      "type": "number",
                      "description": "Days from issue date to due date",
                      "example": 30
                    },
                    "lineItems": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {},
                      "description": "Line items stored on the recurring series"
                    },
                    "template": {
                      "description": "Template settings stored on the recurring series"
                    },
                    "paymentDetails": {
                      "description": "Payment details (TipTap JSON)"
                    },
                    "fromDetails": {
                      "description": "From details (TipTap JSON)"
                    },
                    "noteDetails": {
                      "description": "Note details (TipTap JSON)"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "VAT amount"
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal amount"
                    },
                    "topBlock": {
                      "description": "Top content block (TipTap JSON)"
                    },
                    "bottomBlock": {
                      "description": "Bottom content block (TipTap JSON)"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Associated template ID"
                    }
                  },
                  "required": [
                    "id",
                    "createdAt",
                    "updatedAt",
                    "status",
                    "frequency",
                    "frequencyDay",
                    "frequencyWeek",
                    "frequencyInterval",
                    "endType",
                    "endDate",
                    "endCount",
                    "invoicesGenerated",
                    "consecutiveFailures",
                    "nextScheduledAt",
                    "amount",
                    "currency",
                    "customerId",
                    "customerName",
                    "upcomingNotificationSentAt",
                    "customer",
                    "teamId",
                    "userId",
                    "lastGeneratedAt",
                    "timezone",
                    "dueDateOffset"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Update recurring invoice series",
        "operationId": "updateInvoiceRecurring",
        "x-speakeasy-name-override": "update",
        "description": "Update a recurring invoice series configuration. Supports partial updates — only provided fields are modified. Cross-field validation ensures consistency (e.g. frequencyDay required for weekly frequencies, endDate required when endType is on_date). If the customer is changed, the new customer must have an email address.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for the recurring invoice series",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier for the recurring invoice series",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customerId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "customerName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "weekly",
                      "biweekly",
                      "monthly_date",
                      "monthly_weekday",
                      "monthly_last_day",
                      "quarterly",
                      "semi_annual",
                      "annual",
                      "custom"
                    ]
                  },
                  "frequencyDay": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 31
                  },
                  "frequencyWeek": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 5
                  },
                  "frequencyInterval": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "endType": {
                    "type": "string",
                    "enum": [
                      "never",
                      "on_date",
                      "after_count"
                    ]
                  },
                  "endDate": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "endCount": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Timezone for scheduling (e.g., 'America/New_York'). Must be a valid IANA timezone identifier.",
                    "example": "America/New_York"
                  },
                  "dueDateOffset": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "amount": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "currency": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "lineItems": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "price": {
                          "type": "number"
                        },
                        "quantity": {
                          "type": "number",
                          "minimum": 0
                        },
                        "tax": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "taxRate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0,
                          "maximum": 100
                        },
                        "unit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "vat": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "productId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "tax2": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "minimum": 0
                        },
                        "taxPresetId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid"
                        }
                      }
                    }
                  },
                  "template": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "currency": {
                        "type": "string"
                      },
                      "customerLabel": {
                        "type": "string"
                      },
                      "dateFormat": {
                        "type": "string"
                      },
                      "deliveryType": {
                        "type": "string",
                        "enum": [
                          "create",
                          "create_and_send",
                          "scheduled"
                        ]
                      },
                      "descriptionLabel": {
                        "type": "string"
                      },
                      "discountLabel": {
                        "type": "string"
                      },
                      "dueDateLabel": {
                        "type": "string"
                      },
                      "fromLabel": {
                        "type": "string"
                      },
                      "includeDecimals": {
                        "type": "boolean"
                      },
                      "includeDiscount": {
                        "type": "boolean"
                      },
                      "includeLineItemTax": {
                        "type": "boolean"
                      },
                      "includePdf": {
                        "type": "boolean"
                      },
                      "includeQr": {
                        "type": "boolean"
                      },
                      "includeTax": {
                        "type": "boolean"
                      },
                      "includeUnits": {
                        "type": "boolean"
                      },
                      "includeVat": {
                        "type": "boolean"
                      },
                      "invoiceNoLabel": {
                        "type": "string"
                      },
                      "issueDateLabel": {
                        "type": "string"
                      },
                      "lineItemTaxLabel": {
                        "type": "string"
                      },
                      "locale": {
                        "type": "string"
                      },
                      "logoUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "noteLabel": {
                        "type": "string"
                      },
                      "paymentEnabled": {
                        "type": "boolean"
                      },
                      "paymentLabel": {
                        "type": "string"
                      },
                      "paymentTermsDays": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "priceLabel": {
                        "type": "string"
                      },
                      "quantityLabel": {
                        "type": "string"
                      },
                      "sendCopy": {
                        "type": "boolean"
                      },
                      "size": {
                        "type": "string",
                        "enum": [
                          "a4",
                          "letter"
                        ]
                      },
                      "subtotalLabel": {
                        "type": "string"
                      },
                      "taxLabel": {
                        "type": "string"
                      },
                      "taxRate": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                      },
                      "timezone": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "totalLabel": {
                        "type": "string"
                      },
                      "totalSummaryLabel": {
                        "type": "string"
                      },
                      "vatLabel": {
                        "type": "string"
                      },
                      "vatRate": {
                        "type": [
                          "number",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                      },
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "isDefault": {
                        "type": "boolean"
                      },
                      "fromDetails": {},
                      "noteDetails": {},
                      "paymentDetails": {}
                    }
                  },
                  "paymentDetails": {},
                  "fromDetails": {},
                  "noteDetails": {},
                  "vat": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "tax": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "discount": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "subtotal": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "topBlock": {},
                  "bottomBlock": {},
                  "templateId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "paused",
                      "completed",
                      "canceled"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recurring invoice series updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the recurring invoice series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the series was created (ISO 8601)",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the series was last updated (ISO 8601)",
                      "example": "2024-06-15T00:00:00.000Z"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused",
                        "completed",
                        "canceled"
                      ],
                      "description": "Current status of the recurring series",
                      "example": "active"
                    },
                    "frequency": {
                      "type": "string",
                      "enum": [
                        "weekly",
                        "biweekly",
                        "monthly_date",
                        "monthly_weekday",
                        "monthly_last_day",
                        "quarterly",
                        "semi_annual",
                        "annual",
                        "custom"
                      ],
                      "description": "Frequency of invoice generation",
                      "example": "monthly_date"
                    },
                    "frequencyDay": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Day parameter for frequency",
                      "example": 15
                    },
                    "frequencyWeek": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Week parameter for monthly_weekday frequency",
                      "example": null
                    },
                    "frequencyInterval": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Interval for custom frequency",
                      "example": null
                    },
                    "endType": {
                      "type": "string",
                      "enum": [
                        "never",
                        "on_date",
                        "after_count"
                      ],
                      "description": "How the series ends",
                      "example": "after_count"
                    },
                    "endDate": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "End date (if endType is 'on_date')",
                      "example": null
                    },
                    "endCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "End count (if endType is 'after_count')",
                      "example": 12
                    },
                    "invoicesGenerated": {
                      "type": "number",
                      "description": "Number of invoices generated so far",
                      "example": 3
                    },
                    "consecutiveFailures": {
                      "type": "number",
                      "description": "Number of consecutive failures",
                      "example": 0
                    },
                    "nextScheduledAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Next scheduled generation date (ISO 8601)",
                      "example": "2026-02-15T00:00:00.000Z"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Invoice amount",
                      "example": 1500
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code",
                      "example": "USD"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Customer ID",
                      "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Customer name",
                      "example": "Acme Corporation"
                    },
                    "upcomingNotificationSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the upcoming notification was last sent (ISO 8601)",
                      "example": "2026-02-01T12:00:00.000Z"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email"
                      ],
                      "description": "Customer details"
                    },
                    "teamId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Team ID for the recurring series"
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "User who created the recurring series"
                    },
                    "lastGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the last invoice was generated (ISO 8601)",
                      "example": "2026-01-15T00:00:00.000Z"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone used for scheduling",
                      "example": "UTC"
                    },
                    "dueDateOffset": {
                      "type": "number",
                      "description": "Days from issue date to due date",
                      "example": 30
                    },
                    "lineItems": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {},
                      "description": "Line items stored on the recurring series"
                    },
                    "template": {
                      "description": "Template settings stored on the recurring series"
                    },
                    "paymentDetails": {
                      "description": "Payment details (TipTap JSON)"
                    },
                    "fromDetails": {
                      "description": "From details (TipTap JSON)"
                    },
                    "noteDetails": {
                      "description": "Note details (TipTap JSON)"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "VAT amount"
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal amount"
                    },
                    "topBlock": {
                      "description": "Top content block (TipTap JSON)"
                    },
                    "bottomBlock": {
                      "description": "Bottom content block (TipTap JSON)"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Associated template ID"
                    }
                  },
                  "required": [
                    "id",
                    "createdAt",
                    "updatedAt",
                    "status",
                    "frequency",
                    "frequencyDay",
                    "frequencyWeek",
                    "frequencyInterval",
                    "endType",
                    "endDate",
                    "endCount",
                    "invoicesGenerated",
                    "consecutiveFailures",
                    "nextScheduledAt",
                    "amount",
                    "currency",
                    "customerId",
                    "customerName",
                    "upcomingNotificationSentAt",
                    "customer",
                    "teamId",
                    "userId",
                    "lastGeneratedAt",
                    "timezone",
                    "dueDateOffset"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete recurring invoice series",
        "operationId": "deleteInvoiceRecurring",
        "x-speakeasy-name-override": "delete",
        "description": "Delete a recurring invoice series. Cancels all scheduled jobs and reverts any scheduled invoices back to draft status. Previously generated invoices are not affected — they remain as independent invoices. Returns 404 if the series is not found.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for the recurring invoice series to delete",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier for the recurring invoice series to delete",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring invoice series deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-recurring/{id}/pause": {
      "post": {
        "summary": "Pause recurring invoice series",
        "operationId": "pauseInvoiceRecurring",
        "x-speakeasy-name-override": "pause",
        "description": "Pause an active recurring invoice series. Stops future invoice generation and reverts any already-scheduled invoices back to draft status, canceling their scheduled jobs. A paused series can be resumed later. Returns 404 if the series is not found.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for the recurring invoice series",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier for the recurring invoice series",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring invoice series paused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the recurring invoice series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the series was created (ISO 8601)",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the series was last updated (ISO 8601)",
                      "example": "2024-06-15T00:00:00.000Z"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused",
                        "completed",
                        "canceled"
                      ],
                      "description": "Current status of the recurring series",
                      "example": "active"
                    },
                    "frequency": {
                      "type": "string",
                      "enum": [
                        "weekly",
                        "biweekly",
                        "monthly_date",
                        "monthly_weekday",
                        "monthly_last_day",
                        "quarterly",
                        "semi_annual",
                        "annual",
                        "custom"
                      ],
                      "description": "Frequency of invoice generation",
                      "example": "monthly_date"
                    },
                    "frequencyDay": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Day parameter for frequency",
                      "example": 15
                    },
                    "frequencyWeek": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Week parameter for monthly_weekday frequency",
                      "example": null
                    },
                    "frequencyInterval": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Interval for custom frequency",
                      "example": null
                    },
                    "endType": {
                      "type": "string",
                      "enum": [
                        "never",
                        "on_date",
                        "after_count"
                      ],
                      "description": "How the series ends",
                      "example": "after_count"
                    },
                    "endDate": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "End date (if endType is 'on_date')",
                      "example": null
                    },
                    "endCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "End count (if endType is 'after_count')",
                      "example": 12
                    },
                    "invoicesGenerated": {
                      "type": "number",
                      "description": "Number of invoices generated so far",
                      "example": 3
                    },
                    "consecutiveFailures": {
                      "type": "number",
                      "description": "Number of consecutive failures",
                      "example": 0
                    },
                    "nextScheduledAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Next scheduled generation date (ISO 8601)",
                      "example": "2026-02-15T00:00:00.000Z"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Invoice amount",
                      "example": 1500
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code",
                      "example": "USD"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Customer ID",
                      "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Customer name",
                      "example": "Acme Corporation"
                    },
                    "upcomingNotificationSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the upcoming notification was last sent (ISO 8601)",
                      "example": "2026-02-01T12:00:00.000Z"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email"
                      ],
                      "description": "Customer details"
                    },
                    "teamId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Team ID for the recurring series"
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "User who created the recurring series"
                    },
                    "lastGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the last invoice was generated (ISO 8601)",
                      "example": "2026-01-15T00:00:00.000Z"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone used for scheduling",
                      "example": "UTC"
                    },
                    "dueDateOffset": {
                      "type": "number",
                      "description": "Days from issue date to due date",
                      "example": 30
                    },
                    "lineItems": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {},
                      "description": "Line items stored on the recurring series"
                    },
                    "template": {
                      "description": "Template settings stored on the recurring series"
                    },
                    "paymentDetails": {
                      "description": "Payment details (TipTap JSON)"
                    },
                    "fromDetails": {
                      "description": "From details (TipTap JSON)"
                    },
                    "noteDetails": {
                      "description": "Note details (TipTap JSON)"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "VAT amount"
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal amount"
                    },
                    "topBlock": {
                      "description": "Top content block (TipTap JSON)"
                    },
                    "bottomBlock": {
                      "description": "Bottom content block (TipTap JSON)"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Associated template ID"
                    }
                  },
                  "required": [
                    "id",
                    "createdAt",
                    "updatedAt",
                    "status",
                    "frequency",
                    "frequencyDay",
                    "frequencyWeek",
                    "frequencyInterval",
                    "endType",
                    "endDate",
                    "endCount",
                    "invoicesGenerated",
                    "consecutiveFailures",
                    "nextScheduledAt",
                    "amount",
                    "currency",
                    "customerId",
                    "customerName",
                    "upcomingNotificationSentAt",
                    "customer",
                    "teamId",
                    "userId",
                    "lastGeneratedAt",
                    "timezone",
                    "dueDateOffset"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-recurring/{id}/resume": {
      "post": {
        "summary": "Resume recurring invoice series",
        "operationId": "resumeInvoiceRecurring",
        "x-speakeasy-name-override": "resume",
        "description": "Resume a paused recurring invoice series. Reactivates future invoice generation from where it left off. Returns 404 if the series is not found or is not currently paused.\n\nRequired scopes: invoices.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.write"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for the recurring invoice series",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier for the recurring invoice series",
            "in": "path",
            "name": "id"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring invoice series resumed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the recurring invoice series",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the series was created (ISO 8601)",
                      "example": "2024-06-01T00:00:00.000Z"
                    },
                    "updatedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the series was last updated (ISO 8601)",
                      "example": "2024-06-15T00:00:00.000Z"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused",
                        "completed",
                        "canceled"
                      ],
                      "description": "Current status of the recurring series",
                      "example": "active"
                    },
                    "frequency": {
                      "type": "string",
                      "enum": [
                        "weekly",
                        "biweekly",
                        "monthly_date",
                        "monthly_weekday",
                        "monthly_last_day",
                        "quarterly",
                        "semi_annual",
                        "annual",
                        "custom"
                      ],
                      "description": "Frequency of invoice generation",
                      "example": "monthly_date"
                    },
                    "frequencyDay": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Day parameter for frequency",
                      "example": 15
                    },
                    "frequencyWeek": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Week parameter for monthly_weekday frequency",
                      "example": null
                    },
                    "frequencyInterval": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Interval for custom frequency",
                      "example": null
                    },
                    "endType": {
                      "type": "string",
                      "enum": [
                        "never",
                        "on_date",
                        "after_count"
                      ],
                      "description": "How the series ends",
                      "example": "after_count"
                    },
                    "endDate": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "End date (if endType is 'on_date')",
                      "example": null
                    },
                    "endCount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "End count (if endType is 'after_count')",
                      "example": 12
                    },
                    "invoicesGenerated": {
                      "type": "number",
                      "description": "Number of invoices generated so far",
                      "example": 3
                    },
                    "consecutiveFailures": {
                      "type": "number",
                      "description": "Number of consecutive failures",
                      "example": 0
                    },
                    "nextScheduledAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Next scheduled generation date (ISO 8601)",
                      "example": "2026-02-15T00:00:00.000Z"
                    },
                    "amount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Invoice amount",
                      "example": 1500
                    },
                    "currency": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Currency code",
                      "example": "USD"
                    },
                    "customerId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Customer ID",
                      "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Customer name",
                      "example": "Acme Corporation"
                    },
                    "upcomingNotificationSentAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the upcoming notification was last sent (ISO 8601)",
                      "example": "2026-02-01T12:00:00.000Z"
                    },
                    "customer": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "website": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email"
                      ],
                      "description": "Customer details"
                    },
                    "teamId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Team ID for the recurring series"
                    },
                    "userId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "User who created the recurring series"
                    },
                    "lastGeneratedAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the last invoice was generated (ISO 8601)",
                      "example": "2026-01-15T00:00:00.000Z"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Timezone used for scheduling",
                      "example": "UTC"
                    },
                    "dueDateOffset": {
                      "type": "number",
                      "description": "Days from issue date to due date",
                      "example": 30
                    },
                    "lineItems": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {},
                      "description": "Line items stored on the recurring series"
                    },
                    "template": {
                      "description": "Template settings stored on the recurring series"
                    },
                    "paymentDetails": {
                      "description": "Payment details (TipTap JSON)"
                    },
                    "fromDetails": {
                      "description": "From details (TipTap JSON)"
                    },
                    "noteDetails": {
                      "description": "Note details (TipTap JSON)"
                    },
                    "vat": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "VAT amount"
                    },
                    "tax": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax amount"
                    },
                    "discount": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Discount amount"
                    },
                    "subtotal": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Subtotal amount"
                    },
                    "topBlock": {
                      "description": "Top content block (TipTap JSON)"
                    },
                    "bottomBlock": {
                      "description": "Bottom content block (TipTap JSON)"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Associated template ID"
                    }
                  },
                  "required": [
                    "id",
                    "createdAt",
                    "updatedAt",
                    "status",
                    "frequency",
                    "frequencyDay",
                    "frequencyWeek",
                    "frequencyInterval",
                    "endType",
                    "endDate",
                    "endCount",
                    "invoicesGenerated",
                    "consecutiveFailures",
                    "nextScheduledAt",
                    "amount",
                    "currency",
                    "customerId",
                    "customerName",
                    "upcomingNotificationSentAt",
                    "customer",
                    "teamId",
                    "userId",
                    "lastGeneratedAt",
                    "timezone",
                    "dueDateOffset"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/invoice-recurring/{id}/upcoming": {
      "get": {
        "summary": "Preview upcoming invoices for a series",
        "operationId": "getInvoiceRecurringUpcoming",
        "x-speakeasy-name-override": "upcoming",
        "description": "Preview the next scheduled invoices for a recurring series. Returns projected dates and amounts based on the series frequency and end conditions. Use the limit parameter to control how many upcoming invoices to preview. Returns 404 if the series is not found.\n\nRequired scopes: invoices.read",
        "tags": [
          "Invoices"
        ],
        "x-oppulence-required-scopes": [
          "invoices.read"
        ],
        "security": [
          {
            "oauth2": [
              "invoices.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier for the recurring invoice series",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier for the recurring invoice series",
            "in": "path",
            "name": "id"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 50,
              "default": 10,
              "description": "Maximum number of upcoming invoices to preview"
            },
            "required": false,
            "description": "Maximum number of upcoming invoices to preview",
            "in": "query",
            "name": "limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Upcoming recurring invoice preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "description": "Scheduled date for the invoice (ISO 8601)",
                            "example": "2026-02-01T00:00:00.000Z"
                          },
                          "amount": {
                            "type": "number",
                            "description": "Invoice amount",
                            "example": 1500
                          }
                        },
                        "required": [
                          "date",
                          "amount"
                        ]
                      },
                      "description": "List of upcoming scheduled invoices"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "hasEndDate": {
                          "type": "boolean",
                          "description": "Whether the series has an end date or count",
                          "example": true
                        },
                        "totalCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total number of invoices in the series (null if no end)",
                          "example": 12
                        },
                        "totalAmount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total amount of all invoices (null if no end)",
                          "example": 18000
                        },
                        "currency": {
                          "type": "string",
                          "description": "Currency code",
                          "example": "USD"
                        }
                      },
                      "required": [
                        "hasEndDate",
                        "totalCount",
                        "totalAmount",
                        "currency"
                      ],
                      "description": "Summary of the recurring series"
                    }
                  },
                  "required": [
                    "invoices",
                    "summary"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "summary": "Search",
        "operationId": "search",
        "x-speakeasy-name-override": "search",
        "description": "Full-text search across invoices, documents, customers, transactions, and other entities for the authenticated team. Multi-word queries use a tighter relevance threshold to surface only high-confidence matches. Results are ranked by relevance score.\n\nRequired scopes: search.read",
        "tags": [
          "Search"
        ],
        "x-oppulence-required-scopes": [
          "search.read"
        ],
        "security": [
          {
            "oauth2": [
              "search.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The term to search for across all data sources.",
              "example": "Acme"
            },
            "required": false,
            "description": "The term to search for across all data sources.",
            "name": "searchTerm",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Language code to use for search relevance and results.",
              "example": "en"
            },
            "required": false,
            "description": "Language code to use for search relevance and results.",
            "name": "language",
            "in": "query"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 1000,
              "default": 30,
              "description": "Maximum number of results to return.",
              "example": 30
            },
            "required": false,
            "description": "Maximum number of results to return.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "default": 5,
              "description": "Maximum number of results to return per table/entity.",
              "example": 5
            },
            "required": false,
            "description": "Maximum number of results to return per table/entity.",
            "name": "itemsPerTableLimit",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "default": 0.01,
              "description": "Minimum relevance score threshold for including a result.",
              "example": 0.01
            },
            "required": false,
            "description": "Minimum relevance score threshold for including a result.",
            "name": "relevanceThreshold",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Search results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier for the search result item.",
                        "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the entity returned (e.g., invoice, customer, transaction).",
                        "example": "invoice"
                      },
                      "relevance": {
                        "type": "number",
                        "description": "Relevance score for the search result.",
                        "example": 0.92
                      },
                      "created_at": {
                        "type": "string",
                        "description": "ISO 8601 timestamp when the entity was created.",
                        "example": "2024-06-01T00:00:00.000Z"
                      },
                      "data": {
                        "description": "Additional data for the search result, structure depends on the type.",
                        "example": {
                          "invoiceNumber": "INV-2024-001",
                          "customerName": "Acme Corporation",
                          "amount": 1500.75
                        }
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "relevance",
                      "created_at"
                    ]
                  },
                  "description": "Search results.",
                  "example": [
                    {
                      "id": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a",
                      "type": "invoice",
                      "relevance": 0.92,
                      "created_at": "2024-06-01T00:00:00.000Z",
                      "data": {
                        "invoiceNumber": "INV-2024-001",
                        "customerName": "Acme Corporation",
                        "amount": 1500.75
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/reports/revenue": {
      "get": {
        "summary": "Revenue reports",
        "operationId": "getRevenueReports",
        "x-speakeasy-name-override": "revenue",
        "description": "Generate revenue reports for the authenticated team over a date range. Aggregates income from transactions filtered by currency and revenue type. Returns time-series data points with totals.\n\nRequired scopes: reports.read",
        "tags": [
          "Reports"
        ],
        "x-oppulence-required-scopes": [
          "reports.read"
        ],
        "security": [
          {
            "oauth2": [
              "reports.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "gross",
                "net"
              ],
              "description": "Revenue type for report calculations",
              "example": "net"
            },
            "required": false,
            "description": "Revenue type for report calculations",
            "name": "revenueType",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Revenue reports for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRevenueResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/reports/profit": {
      "get": {
        "summary": "Profit reports",
        "operationId": "getProfitReports",
        "x-speakeasy-name-override": "profit",
        "description": "Generate profit reports for the authenticated team over a date range. Calculates net profit by subtracting expenses from revenue, filtered by currency and revenue type. Returns time-series data points with totals.\n\nRequired scopes: reports.read",
        "tags": [
          "Reports"
        ],
        "x-oppulence-required-scopes": [
          "reports.read"
        ],
        "security": [
          {
            "oauth2": [
              "reports.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "gross",
                "net"
              ],
              "description": "Revenue type for report calculations",
              "example": "net"
            },
            "required": false,
            "description": "Revenue type for report calculations",
            "name": "revenueType",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Profit reports for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProfitResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/reports/burn-rate": {
      "get": {
        "summary": "Burn rate reports",
        "operationId": "getBurnRateReports",
        "x-speakeasy-name-override": "burn-rate",
        "description": "Calculate the cash burn rate for the authenticated team over a date range. Shows how fast the team is spending relative to income, filtered by currency. Useful for understanding monthly net cash flow trends.\n\nRequired scopes: reports.read",
        "tags": [
          "Reports"
        ],
        "x-oppulence-required-scopes": [
          "reports.read"
        ],
        "security": [
          {
            "oauth2": [
              "reports.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Burn rate reports for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBurnRateResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/reports/runway": {
      "get": {
        "summary": "Runway reports",
        "operationId": "getRunwayReports",
        "x-speakeasy-name-override": "runway",
        "description": "Estimate the financial runway for the authenticated team. Based on current cash balance and average burn rate over the specified period, projects how many months of operation remain. Filtered by currency.\n\nRequired scopes: reports.read",
        "tags": [
          "Reports"
        ],
        "x-oppulence-required-scopes": [
          "reports.read"
        ],
        "security": [
          {
            "oauth2": [
              "reports.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Runway reports for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "number",
                  "title": "GetRunwayResponseSchema",
                  "description": "Number of months of runway remaining, based on current burn rate and available cash.",
                  "example": 12
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/reports/expenses": {
      "get": {
        "summary": "Expense reports",
        "operationId": "getExpensesReports",
        "x-speakeasy-name-override": "expenses",
        "description": "Generate expense reports for the authenticated team over a date range. Aggregates outgoing transactions by category, filtered by currency. Returns time-series data with category breakdowns and totals.\n\nRequired scopes: reports.read",
        "tags": [
          "Reports"
        ],
        "x-oppulence-required-scopes": [
          "reports.read"
        ],
        "security": [
          {
            "oauth2": [
              "reports.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Expense reports for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetExpensesResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/reports/spending": {
      "get": {
        "summary": "Spending reports",
        "operationId": "getSpendingReports",
        "x-speakeasy-name-override": "spending",
        "description": "Generate spending reports for the authenticated team over a date range. Groups expenses by merchant or category to identify top spending areas, filtered by currency. Returns ranked spending breakdowns with totals.\n\nRequired scopes: reports.read",
        "tags": [
          "Reports"
        ],
        "x-oppulence-required-scopes": [
          "reports.read"
        ],
        "security": [
          {
            "oauth2": [
              "reports.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Spending reports for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpendingResultArray"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/revenue": {
      "get": {
        "description": "Aggregate revenue metrics for the authenticated team over a date range. Filtered by currency and account. Returns time-series data with totals.\n\nRequired scopes: metrics.read",
        "operationId": "getRevenueMetrics",
        "summary": "Revenue metrics",
        "tags": [
          "Metrics"
        ],
        "x-speakeasy-name-override": "revenue",
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ],
              "description": "Group results by account or return consolidated totals",
              "example": "consolidated"
            },
            "required": false,
            "description": "Group results by account or return consolidated totals",
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "boolean",
              "description": "Include categories flagged excluded"
            },
            "required": false,
            "description": "Include categories flagged excluded",
            "name": "includeExcludedCategories",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Filter by bank account IDs",
              "example": [
                "uuid-account-1",
                "uuid-account-2"
              ]
            },
            "required": false,
            "description": "Filter by bank account IDs",
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Revenue metrics for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRevenueResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/balances": {
      "get": {
        "operationId": "getBalances",
        "summary": "Current balances",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Balances",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalancesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/recovery-rate": {
      "get": {
        "summary": "Collections recovery rate",
        "operationId": "getCollectionsRecoveryRate",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Recovery rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollectionsRecoveryRateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/funnel": {
      "get": {
        "summary": "Collections funnel",
        "operationId": "getCollectionsFunnel",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Funnel series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollectionsFunnelResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/promise-to-pay": {
      "get": {
        "summary": "Promises to pay summary",
        "operationId": "getPromisesToPay",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Promises summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromisesToPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/write-offs": {
      "get": {
        "summary": "Write-offs",
        "operationId": "getWriteOffs",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Write-offs series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteOffsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/disputes": {
      "get": {
        "summary": "Disputes (approx)",
        "operationId": "getDisputesApprox",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Approx disputes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisputesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/time-to-collect": {
      "get": {
        "summary": "Time to collect",
        "operationId": "getTimeToCollect",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Collection time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeToCollectResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/collections/payment-methods": {
      "get": {
        "summary": "Payment methods breakdown",
        "operationId": "getPaymentMethods",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Payment methods",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethodsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/invoices/status-summary": {
      "get": {
        "summary": "Invoice status summary",
        "operationId": "getInvoiceStatusSummary",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Status summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceStatusSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/invoices/aging-movement": {
      "get": {
        "summary": "Aging movement",
        "operationId": "getInvoiceAgingMovement",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Aging movement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceAgingMovementResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/revenue/discounts": {
      "get": {
        "summary": "Revenue discounts and credits",
        "operationId": "getRevenueDiscounts",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Discounts series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueDiscountsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/revenue/by-product": {
      "get": {
        "summary": "Revenue by product/category",
        "operationId": "getRevenueByProduct",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Revenue by category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueByProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/profit/by-category": {
      "get": {
        "summary": "Profit by category",
        "operationId": "getProfitByCategory",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Profit by category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfitByCategoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/profit/by-customer": {
      "get": {
        "summary": "Profit by customer",
        "operationId": "getProfitByCustomer",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Profit by customer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfitByCustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/cash-flow": {
      "get": {
        "summary": "Cash flow timeseries",
        "operationId": "getCashFlow",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "default": "month",
              "description": "Time granularity for bucketed series"
            },
            "required": false,
            "description": "Time granularity for bucketed series",
            "name": "granularity",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Cash flow series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashFlowResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/revenue/by-customer": {
      "get": {
        "summary": "Revenue by customer",
        "operationId": "getRevenueByCustomer",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Top customers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueByCustomerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/profit-margin": {
      "get": {
        "summary": "Profit margin timeseries",
        "operationId": "getProfitMargin",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Margin series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfitMarginResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/growth-rate": {
      "get": {
        "summary": "Growth rate",
        "operationId": "getGrowthRate",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "revenue",
                "profit"
              ]
            },
            "required": true,
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "mom",
                "yoy"
              ]
            },
            "required": true,
            "name": "window",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Growth rate series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrowthRateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/revenue/recurring-vs-oneoff": {
      "get": {
        "summary": "Recurring vs one-off revenue",
        "operationId": "getRecurringVsOneOff",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "default": "month",
              "description": "Time granularity for bucketed series"
            },
            "required": false,
            "description": "Time granularity for bucketed series",
            "name": "granularity",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Recurring vs one-off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecurringVsOneOffResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/revenue/seasonality": {
      "get": {
        "summary": "Revenue seasonality",
        "operationId": "getRevenueSeasonality",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Seasonal index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeasonalityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/revenue/volatility": {
      "get": {
        "summary": "Revenue volatility",
        "operationId": "getRevenueVolatility",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "default": "month",
              "description": "Time granularity for bucketed series"
            },
            "required": false,
            "description": "Time granularity for bucketed series",
            "name": "granularity",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Volatility",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevenueVolatilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/customers/concentration": {
      "get": {
        "summary": "Revenue concentration",
        "operationId": "getCustomersConcentration",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "required": false,
            "name": "topN",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Concentration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersConcentrationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/customers/geography": {
      "get": {
        "summary": "Revenue by geography",
        "operationId": "getCustomersGeography",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Geography",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersGeographyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/customers/payment-behavior": {
      "get": {
        "summary": "Customer payment behavior",
        "operationId": "getCustomersPaymentBehavior",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Behavior",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersPaymentBehaviorResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/cash-balance": {
      "get": {
        "summary": "Cash balance timeseries",
        "operationId": "getCashBalance",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "default": "month",
              "description": "Time granularity for bucketed series"
            },
            "required": false,
            "description": "Time granularity for bucketed series",
            "name": "granularity",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Cash balance series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CashBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/kpis": {
      "get": {
        "summary": "KPIs batch",
        "operationId": "getKpis",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "select",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "KPIs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KpisResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/invoices/aging": {
      "get": {
        "summary": "Invoice aging",
        "operationId": "getInvoiceAging",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "asOf",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "required": false,
            "name": "buckets",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Aging buckets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceAgingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/stress-test": {
      "post": {
        "summary": "Run a stress test scenario",
        "operationId": "postStressTest",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.write"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StressTestRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stress test result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StressTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/metrics/stress-test/{id}": {
      "get": {
        "summary": "Get a saved stress test",
        "operationId": "getStressTest",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Stress test result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StressTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/forecast/cash-flow": {
      "post": {
        "summary": "Compute cash flow forecast",
        "operationId": "postForecastCashFlow",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.write"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForecastRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Forecast result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "summary": "Get cash flow forecast",
        "operationId": "getForecastCashFlow",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Training start date",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Training start date",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Training end date",
              "example": "2024-01-01"
            },
            "required": true,
            "description": "Training end date",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60,
              "description": "Forecast horizon in months",
              "example": 12
            },
            "required": true,
            "description": "Forecast horizon in months",
            "name": "horizonMonths",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Forecast result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/forecast/revenue": {
      "post": {
        "summary": "Compute revenue forecast",
        "operationId": "postForecastRevenue",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.write"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForecastRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Forecast result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "summary": "Get revenue forecast",
        "operationId": "getForecastRevenue",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Training start date",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Training start date",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Training end date",
              "example": "2024-01-01"
            },
            "required": true,
            "description": "Training end date",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60,
              "description": "Forecast horizon in months",
              "example": 12
            },
            "required": true,
            "description": "Forecast horizon in months",
            "name": "horizonMonths",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Forecast result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForecastResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Required scopes: metrics.read"
      }
    },
    "/metrics/profit": {
      "get": {
        "summary": "Profit metrics",
        "operationId": "getProfitMetrics",
        "x-speakeasy-name-override": "profit",
        "description": "Calculate profit metrics (revenue minus expenses) for the authenticated team over a date range. Filtered by currency and optional account IDs. Returns time-series profit data with totals.\n\nRequired scopes: metrics.read",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "name": "includeExcludedCategories",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Profit metrics for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProfitResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/burn-rate": {
      "get": {
        "summary": "Burn rate metrics",
        "operationId": "getBurnRateMetrics",
        "x-speakeasy-name-override": "burn-rate",
        "description": "Calculate monthly burn rate for the authenticated team over a date range. Shows net cash outflow trends filtered by currency.\n\nRequired scopes: metrics.read",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "name": "includeExcludedCategories",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Burn rate metrics for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBurnRateResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/runway": {
      "get": {
        "summary": "Runway metrics",
        "operationId": "getRunwayMetrics",
        "x-speakeasy-name-override": "runway",
        "description": "Estimate financial runway for the authenticated team. Projects months of operation remaining based on current balance and average burn rate over the period. Filtered by currency.\n\nRequired scopes: metrics.read",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Runway metrics for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRunwayResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/expenses": {
      "get": {
        "summary": "Expense metrics",
        "operationId": "getExpensesMetrics",
        "x-speakeasy-name-override": "expenses",
        "description": "Aggregate expense metrics for the authenticated team over a date range. Groups outgoing transactions by category with time-series breakdowns. Filtered by currency.\n\nRequired scopes: metrics.read",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "name": "includeExcludedCategories",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Expense metrics for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetExpensesResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/spending": {
      "get": {
        "summary": "Spending metrics",
        "operationId": "getSpendingMetrics",
        "x-speakeasy-name-override": "spending",
        "description": "Spending metrics ranked by merchant or category for the authenticated team. Filtered by currency over a date range. Returns ranked breakdowns with totals.\n\nRequired scopes: metrics.read",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "account",
                "consolidated"
              ]
            },
            "required": false,
            "name": "groupBy",
            "in": "query"
          },
          {
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "name": "includeExcludedCategories",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "required": false,
            "name": "accountIds",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Spending metrics for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSpendingResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/transactions-timeseries": {
      "get": {
        "description": "Generate bucketed time-series of transaction data showing net, inflow, outflow, and count per period. Filtered by currency and date range.\n\nRequired scopes: metrics.read",
        "operationId": "getTransactionsTimeseries",
        "summary": "Transactions timeseries",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "default": "month",
              "description": "Time granularity for bucketed series"
            },
            "required": false,
            "description": "Time granularity for bucketed series",
            "name": "granularity",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "net",
                "inflow",
                "outflow",
                "count"
              ],
              "default": "net",
              "description": "Series kind"
            },
            "required": false,
            "description": "Series kind",
            "name": "kind",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217) for normalization"
            },
            "required": false,
            "description": "Currency code (ISO 4217) for normalization",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "name": "includeExcludedCategories",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucketed series of values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsTimeseriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/invoice-status-timeseries": {
      "get": {
        "description": "Generate bucketed time-series of invoice counts and amounts grouped by status (draft, sent, paid, overdue, etc.). Filtered by date range.\n\nRequired scopes: metrics.read",
        "operationId": "getInvoiceStatusTimeseries",
        "summary": "Invoice status timeseries",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "default": "month",
              "description": "Time granularity for bucketed series"
            },
            "required": false,
            "description": "Time granularity for bucketed series",
            "name": "granularity",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucketed status series.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceStatusTimeseriesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/top-merchants": {
      "get": {
        "description": "Rank merchants by total transaction amount and count for the authenticated team. Filtered by currency and date range with a configurable limit.\n\nRequired scopes: metrics.read",
        "operationId": "getTopMerchants",
        "summary": "Top merchants",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "description": "Max merchants",
              "example": 10
            },
            "required": false,
            "description": "Max merchants",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Top merchants for the period.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopMerchantsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/tax-summary": {
      "get": {
        "description": "Summarize tax amounts (paid and collected) grouped by category for the authenticated team. Filtered by currency and date range.\n\nRequired scopes: metrics.read",
        "operationId": "getTaxSummary",
        "summary": "Tax summary",
        "tags": [
          "Metrics"
        ],
        "x-oppulence-required-scopes": [
          "metrics.read"
        ],
        "security": [
          {
            "oauth2": [
              "metrics.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date (ISO 8601 format)",
              "example": "2023-01-01"
            },
            "required": true,
            "description": "Start date (ISO 8601 format)",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date (ISO 8601 format)",
              "example": "2023-12-31"
            },
            "required": true,
            "description": "End date (ISO 8601 format)",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Currency code (ISO 4217)",
              "example": "USD"
            },
            "required": false,
            "description": "Currency code (ISO 4217)",
            "name": "currency",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "paid",
                "collected"
              ],
              "description": "Type of tax",
              "example": "paid"
            },
            "required": true,
            "description": "Type of tax",
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Category slug",
              "example": "taxes"
            },
            "required": false,
            "description": "Category slug",
            "name": "categorySlug",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "Tax type",
              "example": "vat"
            },
            "required": false,
            "description": "Tax type",
            "name": "taxType",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Tax summary for the period.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTaxSummaryResponseSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/categories": {
      "get": {
        "summary": "List all transaction categories",
        "operationId": "listTransactionCategories",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve all transaction categories for the authenticated team, including system-defined and user-created categories. Categories support hierarchical nesting via parentId. Each category includes tax configuration (rate, type, reporting code) and an excluded flag. Use the limit parameter to cap the result count.\n\nRequired scopes: transactions.read",
        "tags": [
          "Transaction Categories"
        ],
        "x-oppulence-required-scopes": [
          "transactions.read"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "number",
              "description": "Maximum number of categories to return",
              "example": 50
            },
            "required": false,
            "description": "Maximum number of categories to return",
            "in": "query",
            "name": "limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a list of transaction categories for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CategoryResponse"
                      },
                      "description": "List of transaction categories"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "description": "Response schema for listing transaction categories",
                  "example": {
                    "data": [
                      {
                        "id": "cat_parent123",
                        "name": "Operations",
                        "slug": "operations",
                        "color": "#2D6CDF",
                        "description": "Core operational expenses",
                        "system": false,
                        "taxRate": null,
                        "taxType": null,
                        "taxReportingCode": null,
                        "excluded": false,
                        "parentId": null,
                        "createdAt": "2024-05-01T12:34:56.789Z",
                        "children": [
                          {
                            "id": "cat_abc123",
                            "name": "Office Supplies",
                            "slug": "office-supplies",
                            "color": "#FF5733",
                            "description": "Expenses related to office supplies and equipment",
                            "system": false,
                            "taxRate": 0.15,
                            "taxType": "VAT",
                            "taxReportingCode": "TAX-001",
                            "excluded": false,
                            "parentId": "cat_parent123",
                            "createdAt": "2024-05-01T12:34:56.789Z",
                            "children": []
                          }
                        ]
                      }
                    ]
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "cat_abc123",
                      "name": "Office Supplies",
                      "slug": "office-supplies",
                      "color": "#FF5733",
                      "description": "Expenses related to office supplies and equipment",
                      "system": false,
                      "taxRate": 0.15,
                      "taxType": "VAT",
                      "taxReportingCode": "TAX-001",
                      "excluded": false,
                      "parentId": null,
                      "createdAt": "2024-05-01T12:34:56.789Z",
                      "children": []
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a transaction category",
        "operationId": "createTransactionCategory",
        "x-speakeasy-name-override": "create",
        "description": "Create a new transaction category for the authenticated team. Provide a name, optional color, description, and tax configuration (rate, type, reporting code). Set parentId to nest under an existing category. A slug is auto-generated from the name.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transaction Categories"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Create a new category. Include tax fields to apply default VAT/GST behavior to matching transactions.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the transaction category",
                    "example": "Office Supplies"
                  },
                  "color": {
                    "type": "string",
                    "description": "Color code for the category",
                    "example": "#FF5733"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the category",
                    "example": "Expenses related to office supplies and equipment"
                  },
                  "taxRate": {
                    "type": "number",
                    "description": "Tax rate applicable to this category",
                    "example": 0.15
                  },
                  "taxType": {
                    "type": "string",
                    "description": "Type of tax applicable",
                    "example": "VAT"
                  },
                  "taxReportingCode": {
                    "type": "string",
                    "description": "Tax reporting code for this category",
                    "example": "TAX-001"
                  },
                  "parentId": {
                    "type": "string",
                    "description": "ID of the parent category if this is a subcategory",
                    "example": "cat_parent123"
                  }
                },
                "required": [
                  "name"
                ],
                "description": "Payload for creating a transaction category.",
                "example": {
                  "name": "Office Supplies",
                  "color": "#FF5733",
                  "description": "Expenses related to office supplies and equipment",
                  "taxRate": 0.15,
                  "taxType": "VAT",
                  "taxReportingCode": "TAX-001",
                  "parentId": "cat_parent123"
                }
              },
              "example": {
                "name": "Office Supplies",
                "color": "#FF5733",
                "description": "Expenses related to office supplies and equipment",
                "taxRate": 0.15,
                "taxType": "VAT",
                "taxReportingCode": "TAX-001",
                "parentId": "cat_parent123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction category created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryResponse"
                },
                "example": {
                  "id": "cat_abc123",
                  "name": "Office Supplies",
                  "slug": "office-supplies",
                  "color": "#FF5733",
                  "description": "Expenses related to office supplies and equipment",
                  "system": false,
                  "taxRate": 0.15,
                  "taxType": "VAT",
                  "taxReportingCode": "TAX-001",
                  "excluded": false,
                  "parentId": null,
                  "createdAt": "2024-05-01T12:34:56.789Z",
                  "children": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/categories/{id}": {
      "get": {
        "summary": "Retrieve a transaction category",
        "operationId": "getTransactionCategoryById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single transaction category by its UUID. Returns the category's name, color, tax configuration, parent relationship, and system flag. The category must belong to the authenticated team.\n\nRequired scopes: transactions.read",
        "tags": [
          "Transaction Categories"
        ],
        "x-oppulence-required-scopes": [
          "transactions.read"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the category to retrieve",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier of the category to retrieve",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieve a transaction category by its ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryResponse"
                },
                "example": {
                  "id": "cat_abc123",
                  "name": "Office Supplies",
                  "slug": "office-supplies",
                  "color": "#FF5733",
                  "description": "Expenses related to office supplies and equipment",
                  "system": false,
                  "taxRate": 0.15,
                  "taxType": "VAT",
                  "taxReportingCode": "TAX-001",
                  "excluded": false,
                  "parentId": null,
                  "createdAt": "2024-05-01T12:34:56.789Z",
                  "children": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a transaction category",
        "operationId": "updateTransactionCategory",
        "x-speakeasy-name-override": "update",
        "description": "Update fields of a transaction category by its UUID. Only provided fields are modified. System categories cannot be renamed. Supports changing name, color, description, tax fields, excluded flag, and parent assignment.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transaction Categories"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "ID of the category to update",
              "example": "cat_abc123"
            },
            "required": true,
            "description": "ID of the category to update",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "description": "Update any mutable fields for an existing category. System categories cannot be renamed.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the transaction category",
                    "example": "Office Supplies"
                  },
                  "color": {
                    "type": "string",
                    "description": "Color code for the category",
                    "example": "#FF5733"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the category",
                    "example": "Expenses related to office supplies and equipment"
                  },
                  "taxRate": {
                    "type": "number",
                    "description": "Tax rate applicable to this category",
                    "example": 0.15
                  },
                  "taxType": {
                    "type": "string",
                    "description": "Type of tax applicable",
                    "example": "VAT"
                  },
                  "taxReportingCode": {
                    "type": "string",
                    "description": "Tax reporting code for this category",
                    "example": "TAX-001"
                  },
                  "parentId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "ID of the parent category if this is a subcategory",
                    "example": "cat_parent123"
                  },
                  "excluded": {
                    "type": "boolean",
                    "default": false,
                    "description": "Whether this category is excluded from analytics and reports. Excluded categories (like Internal Transfers) are hidden from spending breakdowns, P&L calculations, and reports.",
                    "example": false
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Office Supplies",
                "color": "#FF5733",
                "description": "Expenses related to office supplies and equipment",
                "taxRate": 0.15,
                "taxType": "VAT",
                "taxReportingCode": "TAX-001",
                "excluded": false,
                "parentId": "cat_parent123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction category updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryResponse"
                },
                "example": {
                  "id": "cat_abc123",
                  "name": "Office Supplies",
                  "slug": "office-supplies",
                  "color": "#FF5733",
                  "description": "Expenses related to office supplies and equipment",
                  "system": false,
                  "taxRate": 0.15,
                  "taxType": "VAT",
                  "taxReportingCode": "TAX-001",
                  "excluded": false,
                  "parentId": null,
                  "createdAt": "2024-05-01T12:34:56.789Z",
                  "children": []
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a transaction category",
        "operationId": "deleteTransactionCategory",
        "x-speakeasy-name-override": "delete",
        "description": "Delete a transaction category by its UUID. System-defined categories cannot be deleted — only user-created categories are removable. Transactions previously assigned to the deleted category are not automatically reassigned. Returns the deleted category's details on success.\n\nRequired scopes: transactions.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Transaction Categories"
        ],
        "x-oppulence-required-scopes": [
          "transactions.write"
        ],
        "security": [
          {
            "oauth2": [
              "transactions.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "ID of the category to delete",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "ID of the category to delete",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction category deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the deleted category",
                      "example": "cat_abc123"
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the deleted category",
                      "example": "Office Supplies"
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "URL-friendly slug of the deleted category",
                      "example": "office-supplies"
                    },
                    "color": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Color code of the deleted category",
                      "example": "#FF5733"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Description of the deleted category",
                      "example": "Expenses related to office supplies and equipment"
                    },
                    "system": {
                      "type": "boolean",
                      "description": "Whether this was a system-defined category",
                      "example": false
                    },
                    "taxRate": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Tax rate that was applicable to this category",
                      "example": 0.15
                    },
                    "taxType": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Type of tax that was applicable",
                      "example": "VAT"
                    },
                    "taxReportingCode": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Tax reporting code for this category",
                      "example": "TAX-001"
                    },
                    "excluded": {
                      "type": "boolean",
                      "default": false,
                      "description": "Whether this category was excluded from reports",
                      "example": false
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ID of the parent category if this was a subcategory",
                      "example": "cat_parent123"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "color",
                    "description",
                    "system",
                    "taxRate",
                    "taxType",
                    "taxReportingCode",
                    "parentId"
                  ],
                  "description": "Response schema for a deleted transaction category",
                  "example": {
                    "id": "cat_abc123",
                    "name": "Office Supplies",
                    "slug": "office-supplies",
                    "color": "#FF5733",
                    "description": "Expenses related to office supplies and equipment",
                    "system": false,
                    "taxRate": 0.15,
                    "taxType": "VAT",
                    "taxReportingCode": "TAX-001",
                    "excluded": false,
                    "parentId": null
                  }
                },
                "example": {
                  "id": "cat_abc123",
                  "name": "Office Supplies",
                  "slug": "office-supplies",
                  "color": "#FF5733",
                  "description": "Expenses related to office supplies and equipment",
                  "system": false,
                  "taxRate": 0.15,
                  "taxType": "VAT",
                  "taxReportingCode": "TAX-001",
                  "excluded": false,
                  "parentId": null
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tracker-projects": {
      "get": {
        "summary": "List all tracker projects",
        "operationId": "listTrackerProjects",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve a paginated list of time tracker projects for the authenticated team. Supports cursor-based pagination, sorting, and optional filters. Each project groups related time entries.\n\nRequired scopes: tracker-projects.read",
        "tags": [
          "Tracker Projects"
        ],
        "x-oppulence-required-scopes": [
          "tracker-projects.read"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-projects.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Cursor for pagination, representing the last item from the previous page",
              "example": "eyJpZCI6IjEyMyJ9"
            },
            "required": false,
            "description": "Cursor for pagination, representing the last item from the previous page",
            "in": "query",
            "name": "cursor"
          },
          {
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 100,
              "description": "Number of projects to return per page (1-100)",
              "example": 20
            },
            "required": false,
            "description": "Number of projects to return per page (1-100)",
            "in": "query",
            "name": "pageSize"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Search query string to filter projects by name or description",
              "example": "website"
            },
            "required": false,
            "description": "Search query string to filter projects by name or description",
            "in": "query",
            "name": "q"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "Start date for filtering projects by creation date in YYYY-MM-DD format",
              "example": "2024-04-01"
            },
            "required": false,
            "description": "Start date for filtering projects by creation date in YYYY-MM-DD format",
            "in": "query",
            "name": "start"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "description": "End date for filtering projects by creation date in YYYY-MM-DD format",
              "example": "2024-04-30"
            },
            "required": false,
            "description": "End date for filtering projects by creation date in YYYY-MM-DD format",
            "in": "query",
            "name": "end"
          },
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "in_progress",
                "completed",
                null
              ],
              "description": "Filter projects by status",
              "example": "in_progress"
            },
            "required": false,
            "description": "Filter projects by status",
            "in": "query",
            "name": "status"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of customer IDs to filter projects by specific customers",
              "example": [
                "customer-1",
                "customer-2"
              ]
            },
            "required": false,
            "description": "Array of customer IDs to filter projects by specific customers",
            "in": "query",
            "name": "customers"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Array of tag IDs to filter projects by specific tags",
              "example": [
                "tag-1",
                "tag-2"
              ]
            },
            "required": false,
            "description": "Array of tag IDs to filter projects by specific tags",
            "in": "query",
            "name": "tags"
          },
          {
            "schema": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "type": "string"
              },
              "description": "Sorting order as an array of field names. Prefix with '-' for descending order",
              "example": [
                "-createdAt",
                "name"
              ]
            },
            "required": false,
            "description": "Sorting order as an array of field names. Prefix with '-' for descending order",
            "in": "query",
            "name": "sort"
          }
        ],
        "responses": {
          "200": {
            "description": "List all tracker projects for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackerProjectsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a tracker project",
        "operationId": "createTrackerProject",
        "x-speakeasy-name-override": "create",
        "description": "Create a new time tracker project for the authenticated team. Provide a name and optional settings. The project is assigned to the calling user.\n\nRequired scopes: tracker-projects.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Projects"
        ],
        "x-oppulence-required-scopes": [
          "tracker-projects.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-projects.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "description": "Tracker project to create",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Name of the project",
                    "example": "Website Redesign"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Detailed description of the project",
                    "example": "Complete redesign of the company website with modern UI/UX and improved performance"
                  },
                  "estimate": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Estimated total hours required to complete the project",
                    "example": 120
                  },
                  "billable": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "default": false,
                    "description": "Whether the project is billable to the customer",
                    "example": true
                  },
                  "rate": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "Hourly rate for the project in the specified currency",
                    "example": 75
                  },
                  "currency": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Currency code for the project rate in ISO 4217 format",
                    "example": "USD"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "in_progress",
                      "completed"
                    ],
                    "description": "Current status of the project",
                    "example": "in_progress"
                  },
                  "customerId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Unique identifier of the customer associated with this project",
                    "example": "a1b2c3d4-e5f6-7890-abcd-1234567890ef"
                  },
                  "tags": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tag",
                          "example": "f1e2d3c4-b5a6-7890-1234-567890abcdef"
                        },
                        "value": {
                          "type": "string",
                          "description": "Display value of the tag",
                          "example": "Design"
                        }
                      },
                      "required": [
                        "id",
                        "value"
                      ]
                    },
                    "description": "Array of tags to associate with the project"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "New Project"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tracker project created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackerProjectResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/tracker-projects/{id}": {
      "patch": {
        "summary": "Update a tracker project",
        "operationId": "updateTrackerProject",
        "x-speakeasy-name-override": "update",
        "description": "Update a time tracker project by its UUID. Only provided fields are modified. The project must belong to the authenticated team.\n\nRequired scopes: tracker-projects.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Projects"
        ],
        "x-oppulence-required-scopes": [
          "tracker-projects.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-projects.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the project to retrieve",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier of the project to retrieve",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Name of the project",
                    "example": "Website Redesign"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Detailed description of the project",
                    "example": "Complete redesign of the company website with modern UI/UX and improved performance"
                  },
                  "estimate": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Estimated total hours required to complete the project",
                    "example": 120
                  },
                  "billable": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "default": false,
                    "description": "Whether the project is billable to the customer",
                    "example": true
                  },
                  "rate": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 1,
                    "description": "Hourly rate for the project in the specified currency",
                    "example": 75
                  },
                  "currency": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Currency code for the project rate in ISO 4217 format",
                    "example": "USD"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "in_progress",
                      "completed"
                    ],
                    "description": "Current status of the project",
                    "example": "in_progress"
                  },
                  "customerId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Unique identifier of the customer associated with this project",
                    "example": "a1b2c3d4-e5f6-7890-abcd-1234567890ef"
                  },
                  "tags": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tag",
                          "example": "f1e2d3c4-b5a6-7890-1234-567890abcdef"
                        },
                        "value": {
                          "type": "string",
                          "description": "Display value of the tag",
                          "example": "Design"
                        }
                      },
                      "required": [
                        "id",
                        "value"
                      ]
                    },
                    "description": "Array of tags to associate with the project"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tracker project updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackerProjectResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Retrieve a tracker project",
        "operationId": "getTrackerProjectById",
        "x-speakeasy-name-override": "get",
        "description": "Retrieve a single time tracker project by its UUID. Returns the project's name, settings, and summary data. The project must belong to the authenticated team.\n\nRequired scopes: tracker-projects.read",
        "tags": [
          "Tracker Projects"
        ],
        "x-oppulence-required-scopes": [
          "tracker-projects.read"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-projects.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the project to retrieve",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier of the project to retrieve",
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracker project by ID for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackerProjectResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a tracker project",
        "operationId": "deleteTrackerProject",
        "x-speakeasy-name-override": "delete",
        "description": "Permanently delete a time tracker project by its UUID. The project must belong to the authenticated team. Associated time entries may be orphaned.\n\nRequired scopes: tracker-projects.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Projects"
        ],
        "x-oppulence-required-scopes": [
          "tracker-projects.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-projects.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the project to retrieve",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier of the project to retrieve",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracker project deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the project to delete",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tracker-entries": {
      "get": {
        "summary": "List all tracker entries",
        "operationId": "listTrackerEntries",
        "x-speakeasy-name-override": "list",
        "description": "Retrieve time tracker entries for the authenticated team within a date range. Returns entries with their associated projects, durations, and assigned users. Supports date range filtering via query parameters.\n\nRequired scopes: tracker-entries.read",
        "tags": [
          "Tracker Entries"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.read"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "Start date of the range (inclusive) in YYYY-MM-DD format",
              "example": "2024-04-01"
            },
            "required": true,
            "description": "Start date of the range (inclusive) in YYYY-MM-DD format",
            "in": "query",
            "name": "from"
          },
          {
            "schema": {
              "type": "string",
              "description": "End date of the range (inclusive) in YYYY-MM-DD format",
              "example": "2024-04-30"
            },
            "required": true,
            "description": "End date of the range (inclusive) in YYYY-MM-DD format",
            "in": "query",
            "name": "to"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Optional project ID to filter tracker entries by specific project",
              "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
            },
            "required": false,
            "description": "Optional project ID to filter tracker entries by specific project",
            "in": "query",
            "name": "projectId"
          }
        ],
        "responses": {
          "200": {
            "description": "List all tracker entries for the authenticated team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "totalDuration": {
                          "type": "number",
                          "description": "Total duration of all tracker entries in the response in seconds",
                          "example": 86400
                        },
                        "totalAmount": {
                          "type": "number",
                          "description": "Total monetary amount for all tracker entries in the response",
                          "example": 1800
                        },
                        "from": {
                          "type": "string",
                          "description": "Start date of the queried range in YYYY-MM-DD format",
                          "example": "2024-04-01"
                        },
                        "to": {
                          "type": "string",
                          "description": "End date of the queried range in YYYY-MM-DD format",
                          "example": "2024-04-30"
                        }
                      },
                      "required": [
                        "totalDuration",
                        "totalAmount",
                        "from",
                        "to"
                      ],
                      "description": "Metadata about the tracker entries response including totals and date range"
                    },
                    "result": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the tracker entry",
                              "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Date and time when the tracker entry was created in ISO 8601 format",
                              "example": "2024-04-15T09:00:00.000Z"
                            },
                            "duration": {
                              "type": "number",
                              "description": "Duration of the tracker entry in seconds",
                              "example": 28800
                            },
                            "start": {
                              "type": "string",
                              "description": "Start time of the tracker entry in ISO 8601 format",
                              "example": "2024-04-15T09:00:00.000Z"
                            },
                            "stop": {
                              "type": "string",
                              "description": "Stop time of the tracker entry in ISO 8601 format",
                              "example": "2024-04-15T17:00:00.000Z"
                            },
                            "teamId": {
                              "type": "string",
                              "description": "Unique identifier of the team that owns this tracker entry",
                              "example": "team-1234"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Description or notes for the tracker entry",
                              "example": "Worked on implementing user authentication feature"
                            },
                            "rate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Hourly rate applied to this tracker entry",
                              "example": 75
                            },
                            "currency": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Currency code for the rate in ISO 4217 format",
                              "example": "USD"
                            },
                            "billed": {
                              "type": "boolean",
                              "description": "Whether this tracker entry has been billed to the customer",
                              "example": false
                            },
                            "date": {
                              "type": "string",
                              "description": "Date of the tracker entry in YYYY-MM-DD format",
                              "example": "2024-04-15"
                            },
                            "user": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "Unique identifier of the user",
                                  "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                                },
                                "fullName": {
                                  "type": "string",
                                  "description": "Full name of the user",
                                  "example": "Jane Doe"
                                },
                                "avatarUrl": {
                                  "type": "string",
                                  "description": "URL to the user's avatar image",
                                  "example": "https://cdn.eigenn.io/avatar.jpg"
                                }
                              },
                              "required": [
                                "id",
                                "fullName",
                                "avatarUrl"
                              ],
                              "description": "User information for the person who created this tracker entry"
                            },
                            "project": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "Unique identifier of the project",
                                  "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "description": "Date and time when the project was created in ISO 8601 format",
                                  "example": "2024-03-01T10:00:00.000Z"
                                },
                                "rate": {
                                  "type": [
                                    "number",
                                    "null"
                                  ],
                                  "description": "Default hourly rate for the project",
                                  "example": 75
                                },
                                "currency": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Currency code for the project rate in ISO 4217 format",
                                  "example": "USD"
                                },
                                "status": {
                                  "type": "string",
                                  "description": "Current status of the project",
                                  "example": "in_progress"
                                },
                                "description": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "Description of the project",
                                  "example": "Complete website redesign with modern UI/UX"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the project",
                                  "example": "Website Redesign Project"
                                },
                                "billable": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ],
                                  "description": "Whether the project is billable to the customer",
                                  "example": true
                                },
                                "estimate": {
                                  "type": [
                                    "number",
                                    "null"
                                  ],
                                  "description": "Estimated total hours for the project",
                                  "example": 120
                                },
                                "customer": {
                                  "type": [
                                    "object",
                                    "null"
                                  ],
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "description": "Unique identifier of the customer",
                                      "example": "customer-1234"
                                    },
                                    "name": {
                                      "type": "string",
                                      "description": "Name of the customer or organization",
                                      "example": "Acme Corporation"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "description": "Customer information associated with the project"
                                }
                              },
                              "required": [
                                "id",
                                "createdAt",
                                "rate",
                                "currency",
                                "status",
                                "description",
                                "name",
                                "billable",
                                "estimate",
                                "customer"
                              ],
                              "description": "Project information associated with this tracker entry"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "duration",
                            "start",
                            "stop",
                            "teamId",
                            "description",
                            "rate",
                            "currency",
                            "billed",
                            "date",
                            "user",
                            "project"
                          ]
                        }
                      },
                      "description": "Tracker entries grouped by date, where each key is a date in YYYY-MM-DD format and the value is an array of tracker entries for that date"
                    }
                  },
                  "required": [
                    "meta",
                    "result"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a tracker entry",
        "operationId": "createTrackerEntry",
        "x-speakeasy-name-override": "create",
        "description": "Create or upsert a time tracker entry for the authenticated team. Specify the project, start/stop times, and duration. If assignedId is omitted, the entry is assigned to the calling user. Returns the created entry with its associated project.\n\nRequired scopes: tracker-entries.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Entries"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Start time of the tracker entry in ISO 8601 format",
                    "example": "2024-04-15T09:00:00.000Z"
                  },
                  "stop": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Stop time of the tracker entry in ISO 8601 format",
                    "example": "2024-04-15T17:00:00.000Z"
                  },
                  "dates": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Date in YYYY-MM-DD format",
                      "example": "2024-04-15"
                    },
                    "description": "Array of dates for which to create tracker entries",
                    "example": [
                      "2024-04-15",
                      "2024-04-16"
                    ]
                  },
                  "assignedId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Unique identifier of the user assigned to this tracker entry",
                    "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  },
                  "projectId": {
                    "type": "string",
                    "description": "Unique identifier of the project associated with this tracker entry",
                    "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional description or notes for the tracker entry",
                    "example": "Worked on implementing user authentication feature"
                  },
                  "duration": {
                    "type": "number",
                    "description": "Duration of the tracker entry in seconds",
                    "example": 28800
                  }
                },
                "required": [
                  "start",
                  "stop",
                  "dates",
                  "assignedId",
                  "projectId",
                  "duration"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Tracker entry created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tracker entry",
                            "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Date and time when the tracker entry was created in ISO 8601 format",
                            "example": "2024-04-15T09:00:00.000Z"
                          },
                          "duration": {
                            "type": "number",
                            "description": "Duration of the tracker entry in seconds",
                            "example": 28800
                          },
                          "start": {
                            "type": "string",
                            "description": "Start time of the tracker entry in ISO 8601 format",
                            "example": "2024-04-15T09:00:00.000Z"
                          },
                          "stop": {
                            "type": "string",
                            "description": "Stop time of the tracker entry in ISO 8601 format",
                            "example": "2024-04-15T17:00:00.000Z"
                          },
                          "teamId": {
                            "type": "string",
                            "description": "Unique identifier of the team that owns this tracker entry",
                            "example": "team-1234"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Description or notes for the tracker entry",
                            "example": "Worked on implementing user authentication feature"
                          },
                          "rate": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Hourly rate applied to this tracker entry",
                            "example": 75
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Currency code for the rate in ISO 4217 format",
                            "example": "USD"
                          },
                          "billed": {
                            "type": "boolean",
                            "description": "Whether this tracker entry has been billed to the customer",
                            "example": false
                          },
                          "date": {
                            "type": "string",
                            "description": "Date of the tracker entry in YYYY-MM-DD format",
                            "example": "2024-04-15"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier of the user",
                                "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                              },
                              "fullName": {
                                "type": "string",
                                "description": "Full name of the user",
                                "example": "Jane Doe"
                              },
                              "avatarUrl": {
                                "type": "string",
                                "description": "URL to the user's avatar image",
                                "example": "https://cdn.eigenn.io/avatar.jpg"
                              }
                            },
                            "required": [
                              "id",
                              "fullName",
                              "avatarUrl"
                            ],
                            "description": "User information for the person who created this tracker entry"
                          },
                          "project": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier of the project",
                                "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                              },
                              "createdAt": {
                                "type": "string",
                                "description": "Date and time when the project was created in ISO 8601 format",
                                "example": "2024-03-01T10:00:00.000Z"
                              },
                              "rate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Default hourly rate for the project",
                                "example": 75
                              },
                              "currency": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Currency code for the project rate in ISO 4217 format",
                                "example": "USD"
                              },
                              "status": {
                                "type": "string",
                                "description": "Current status of the project",
                                "example": "in_progress"
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Description of the project",
                                "example": "Complete website redesign with modern UI/UX"
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the project",
                                "example": "Website Redesign Project"
                              },
                              "billable": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "Whether the project is billable to the customer",
                                "example": true
                              },
                              "estimate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Estimated total hours for the project",
                                "example": 120
                              },
                              "customer": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Unique identifier of the customer",
                                    "example": "customer-1234"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Name of the customer or organization",
                                    "example": "Acme Corporation"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "description": "Customer information associated with the project"
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "rate",
                              "currency",
                              "status",
                              "description",
                              "name",
                              "billable",
                              "estimate",
                              "customer"
                            ],
                            "description": "Project information associated with this tracker entry"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "duration",
                          "start",
                          "stop",
                          "teamId",
                          "description",
                          "rate",
                          "currency",
                          "billed",
                          "date",
                          "user",
                          "project"
                        ]
                      },
                      "description": "Array of created tracker entries"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "description": "Response schema for created tracker entries"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/tracker-entries/bulk": {
      "post": {
        "summary": "Create multiple tracker entries",
        "operationId": "createTrackerEntriesBulk",
        "x-speakeasy-name-override": "createBulk",
        "description": "Create multiple time tracker entries in a single request. Accepts an array of entries, each with project, start/stop times, and duration. If assignedId is omitted on an entry, it defaults to the calling user. Useful for bulk imports and data migration.\n\nRequired scopes: tracker-entries.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Entries"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Start time of the tracker entry in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "stop": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Stop time of the tracker entry in ISO 8601 format",
                          "example": "2024-04-15T17:00:00.000Z"
                        },
                        "dates": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "description": "Date in YYYY-MM-DD format",
                            "example": "2024-04-15"
                          },
                          "description": "Array of dates for which to create tracker entries",
                          "example": [
                            "2024-04-15",
                            "2024-04-16"
                          ]
                        },
                        "assignedId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid",
                          "description": "Unique identifier of the user assigned to this tracker entry",
                          "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                        },
                        "projectId": {
                          "type": "string",
                          "description": "Unique identifier of the project associated with this tracker entry",
                          "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Optional description or notes for the tracker entry",
                          "example": "Worked on implementing user authentication feature"
                        },
                        "duration": {
                          "type": "number",
                          "description": "Duration of the tracker entry in seconds",
                          "example": 28800
                        }
                      },
                      "required": [
                        "start",
                        "stop",
                        "dates",
                        "assignedId",
                        "projectId",
                        "duration"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 100,
                    "description": "Array of tracker entries to create (maximum 100 entries per request)"
                  }
                },
                "required": [
                  "entries"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Tracker entries created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tracker entry",
                            "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Date and time when the tracker entry was created in ISO 8601 format",
                            "example": "2024-04-15T09:00:00.000Z"
                          },
                          "duration": {
                            "type": "number",
                            "description": "Duration of the tracker entry in seconds",
                            "example": 28800
                          },
                          "start": {
                            "type": "string",
                            "description": "Start time of the tracker entry in ISO 8601 format",
                            "example": "2024-04-15T09:00:00.000Z"
                          },
                          "stop": {
                            "type": "string",
                            "description": "Stop time of the tracker entry in ISO 8601 format",
                            "example": "2024-04-15T17:00:00.000Z"
                          },
                          "teamId": {
                            "type": "string",
                            "description": "Unique identifier of the team that owns this tracker entry",
                            "example": "team-1234"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Description or notes for the tracker entry",
                            "example": "Worked on implementing user authentication feature"
                          },
                          "rate": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Hourly rate applied to this tracker entry",
                            "example": 75
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Currency code for the rate in ISO 4217 format",
                            "example": "USD"
                          },
                          "billed": {
                            "type": "boolean",
                            "description": "Whether this tracker entry has been billed to the customer",
                            "example": false
                          },
                          "date": {
                            "type": "string",
                            "description": "Date of the tracker entry in YYYY-MM-DD format",
                            "example": "2024-04-15"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier of the user",
                                "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                              },
                              "fullName": {
                                "type": "string",
                                "description": "Full name of the user",
                                "example": "Jane Doe"
                              },
                              "avatarUrl": {
                                "type": "string",
                                "description": "URL to the user's avatar image",
                                "example": "https://cdn.eigenn.io/avatar.jpg"
                              }
                            },
                            "required": [
                              "id",
                              "fullName",
                              "avatarUrl"
                            ],
                            "description": "User information for the person who created this tracker entry"
                          },
                          "project": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier of the project",
                                "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                              },
                              "createdAt": {
                                "type": "string",
                                "description": "Date and time when the project was created in ISO 8601 format",
                                "example": "2024-03-01T10:00:00.000Z"
                              },
                              "rate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Default hourly rate for the project",
                                "example": 75
                              },
                              "currency": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Currency code for the project rate in ISO 4217 format",
                                "example": "USD"
                              },
                              "status": {
                                "type": "string",
                                "description": "Current status of the project",
                                "example": "in_progress"
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Description of the project",
                                "example": "Complete website redesign with modern UI/UX"
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the project",
                                "example": "Website Redesign Project"
                              },
                              "billable": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "Whether the project is billable to the customer",
                                "example": true
                              },
                              "estimate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Estimated total hours for the project",
                                "example": 120
                              },
                              "customer": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Unique identifier of the customer",
                                    "example": "customer-1234"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Name of the customer or organization",
                                    "example": "Acme Corporation"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "description": "Customer information associated with the project"
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "rate",
                              "currency",
                              "status",
                              "description",
                              "name",
                              "billable",
                              "estimate",
                              "customer"
                            ],
                            "description": "Project information associated with this tracker entry"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "duration",
                          "start",
                          "stop",
                          "teamId",
                          "description",
                          "rate",
                          "currency",
                          "billed",
                          "date",
                          "user",
                          "project"
                        ]
                      },
                      "description": "Array of created tracker entries"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "description": "Response schema for created tracker entries"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/tracker-entries/{id}": {
      "patch": {
        "summary": "Update a tracker entry",
        "operationId": "updateTrackerEntry",
        "x-speakeasy-name-override": "update",
        "description": "Update an existing time tracker entry by its UUID. Only provided fields are modified. The entry must belong to the authenticated team. Returns the updated entry with its associated project.\n\nRequired scopes: tracker-entries.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Entries"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the tracker entry to delete",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier of the tracker entry to delete",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Start time of the tracker entry in ISO 8601 format",
                    "example": "2024-04-15T09:00:00.000Z"
                  },
                  "stop": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Stop time of the tracker entry in ISO 8601 format",
                    "example": "2024-04-15T17:00:00.000Z"
                  },
                  "dates": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "Date in YYYY-MM-DD format",
                      "example": "2024-04-15"
                    },
                    "description": "Array of dates for which to create tracker entries",
                    "example": [
                      "2024-04-15",
                      "2024-04-16"
                    ]
                  },
                  "assignedId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Unique identifier of the user assigned to this tracker entry",
                    "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  },
                  "projectId": {
                    "type": "string",
                    "description": "Unique identifier of the project associated with this tracker entry",
                    "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional description or notes for the tracker entry",
                    "example": "Worked on implementing user authentication feature"
                  },
                  "duration": {
                    "type": "number",
                    "description": "Duration of the tracker entry in seconds",
                    "example": 28800
                  }
                },
                "required": [
                  "start",
                  "stop",
                  "dates",
                  "assignedId",
                  "projectId",
                  "duration"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tracker entry updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier of the tracker entry",
                            "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "Date and time when the tracker entry was created in ISO 8601 format",
                            "example": "2024-04-15T09:00:00.000Z"
                          },
                          "duration": {
                            "type": "number",
                            "description": "Duration of the tracker entry in seconds",
                            "example": 28800
                          },
                          "start": {
                            "type": "string",
                            "description": "Start time of the tracker entry in ISO 8601 format",
                            "example": "2024-04-15T09:00:00.000Z"
                          },
                          "stop": {
                            "type": "string",
                            "description": "Stop time of the tracker entry in ISO 8601 format",
                            "example": "2024-04-15T17:00:00.000Z"
                          },
                          "teamId": {
                            "type": "string",
                            "description": "Unique identifier of the team that owns this tracker entry",
                            "example": "team-1234"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Description or notes for the tracker entry",
                            "example": "Worked on implementing user authentication feature"
                          },
                          "rate": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Hourly rate applied to this tracker entry",
                            "example": 75
                          },
                          "currency": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Currency code for the rate in ISO 4217 format",
                            "example": "USD"
                          },
                          "billed": {
                            "type": "boolean",
                            "description": "Whether this tracker entry has been billed to the customer",
                            "example": false
                          },
                          "date": {
                            "type": "string",
                            "description": "Date of the tracker entry in YYYY-MM-DD format",
                            "example": "2024-04-15"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier of the user",
                                "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                              },
                              "fullName": {
                                "type": "string",
                                "description": "Full name of the user",
                                "example": "Jane Doe"
                              },
                              "avatarUrl": {
                                "type": "string",
                                "description": "URL to the user's avatar image",
                                "example": "https://cdn.eigenn.io/avatar.jpg"
                              }
                            },
                            "required": [
                              "id",
                              "fullName",
                              "avatarUrl"
                            ],
                            "description": "User information for the person who created this tracker entry"
                          },
                          "project": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Unique identifier of the project",
                                "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                              },
                              "createdAt": {
                                "type": "string",
                                "description": "Date and time when the project was created in ISO 8601 format",
                                "example": "2024-03-01T10:00:00.000Z"
                              },
                              "rate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Default hourly rate for the project",
                                "example": 75
                              },
                              "currency": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Currency code for the project rate in ISO 4217 format",
                                "example": "USD"
                              },
                              "status": {
                                "type": "string",
                                "description": "Current status of the project",
                                "example": "in_progress"
                              },
                              "description": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Description of the project",
                                "example": "Complete website redesign with modern UI/UX"
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the project",
                                "example": "Website Redesign Project"
                              },
                              "billable": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "Whether the project is billable to the customer",
                                "example": true
                              },
                              "estimate": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Estimated total hours for the project",
                                "example": 120
                              },
                              "customer": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "Unique identifier of the customer",
                                    "example": "customer-1234"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Name of the customer or organization",
                                    "example": "Acme Corporation"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "description": "Customer information associated with the project"
                              }
                            },
                            "required": [
                              "id",
                              "createdAt",
                              "rate",
                              "currency",
                              "status",
                              "description",
                              "name",
                              "billable",
                              "estimate",
                              "customer"
                            ],
                            "description": "Project information associated with this tracker entry"
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "duration",
                          "start",
                          "stop",
                          "teamId",
                          "description",
                          "rate",
                          "currency",
                          "billed",
                          "date",
                          "user",
                          "project"
                        ]
                      },
                      "description": "Array of created tracker entries"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "description": "Response schema for created tracker entries"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a tracker entry",
        "operationId": "deleteTrackerEntry",
        "x-speakeasy-name-override": "delete",
        "description": "Permanently delete a time tracker entry by its UUID. The entry must belong to the authenticated team.\n\nRequired scopes: tracker-entries.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Entries"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.write"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Unique identifier of the tracker entry to delete",
              "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
            },
            "required": true,
            "description": "Unique identifier of the tracker entry to delete",
            "name": "id",
            "in": "path"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracker entry deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier of the tracker entry to delete",
                      "example": "b3b7e6e2-8c2a-4e2a-9b1a-2e4b5c6d7f8a"
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tracker-entries/timer/start": {
      "post": {
        "summary": "Start a timer",
        "operationId": "startTimer",
        "x-speakeasy-name-override": "startTimer",
        "description": "Start a new timer or resume a paused entry. Creates a tracker entry with the current timestamp as the start time. If assignedId is omitted, the timer is started for the calling user.\n\nRequired scopes: tracker-entries.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Timer"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "projectId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Unique identifier of the project to track time for",
                    "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                  },
                  "assignedId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Unique identifier of the user to assign the timer to. If not provided, will use the authenticated user",
                    "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Optional description for the timer session",
                    "example": "Working on implementing timer feature"
                  },
                  "start": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Start time in ISO 8601 format. If not provided, will use current time",
                    "example": "2024-04-15T09:00:00.000Z"
                  },
                  "continueFromEntry": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Continue from a specific paused entry ID",
                    "example": "c4d5e6f7-2a3b-4c5d-8e9f-3a4b5c6d7e8f"
                  }
                },
                "required": [
                  "projectId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Timer started successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tracker entry",
                          "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "Date and time when the tracker entry was created in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "duration": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Duration of the timer entry in seconds. -1 indicates running, null for paused, positive number for completed",
                          "example": -1
                        },
                        "start": {
                          "type": "string",
                          "description": "Start time of the tracker entry in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "stop": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Stop time of the tracker entry in ISO 8601 format, null while timer is running",
                          "example": "2024-04-15T17:00:00.000Z"
                        },
                        "teamId": {
                          "type": "string",
                          "description": "Unique identifier of the team that owns this tracker entry",
                          "example": "team-1234"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Description or notes for the tracker entry",
                          "example": "Worked on implementing user authentication feature"
                        },
                        "rate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Hourly rate applied to this tracker entry",
                          "example": 75
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Currency code for the rate in ISO 4217 format",
                          "example": "USD"
                        },
                        "billed": {
                          "type": "boolean",
                          "description": "Whether this tracker entry has been billed to the customer",
                          "example": false
                        },
                        "date": {
                          "type": "string",
                          "description": "Date of the tracker entry in YYYY-MM-DD format",
                          "example": "2024-04-15"
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the user",
                              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                            },
                            "fullName": {
                              "type": "string",
                              "description": "Full name of the user",
                              "example": "Jane Doe"
                            },
                            "avatarUrl": {
                              "type": "string",
                              "description": "URL to the user's avatar image",
                              "example": "https://cdn.eigenn.io/avatar.jpg"
                            }
                          },
                          "required": [
                            "id",
                            "fullName",
                            "avatarUrl"
                          ],
                          "description": "User information for the person who created this tracker entry"
                        },
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the project",
                              "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Date and time when the project was created in ISO 8601 format",
                              "example": "2024-03-01T10:00:00.000Z"
                            },
                            "rate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Default hourly rate for the project",
                              "example": 75
                            },
                            "currency": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Currency code for the project rate in ISO 4217 format",
                              "example": "USD"
                            },
                            "status": {
                              "type": "string",
                              "description": "Current status of the project",
                              "example": "in_progress"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Description of the project",
                              "example": "Complete website redesign with modern UI/UX"
                            },
                            "name": {
                              "type": "string",
                              "description": "Name of the project",
                              "example": "Website Redesign Project"
                            },
                            "billable": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "Whether the project is billable to the customer",
                              "example": true
                            },
                            "estimate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Estimated total hours for the project",
                              "example": 120
                            },
                            "customer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "Unique identifier of the customer",
                                  "example": "customer-1234"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the customer or organization",
                                  "example": "Acme Corporation"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "description": "Customer information associated with the project"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "rate",
                            "currency",
                            "status",
                            "description",
                            "name",
                            "billable",
                            "estimate",
                            "customer"
                          ],
                          "description": "Project information associated with this tracker entry"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "duration",
                        "start",
                        "stop",
                        "teamId",
                        "description",
                        "rate",
                        "currency",
                        "billed",
                        "date",
                        "user",
                        "project"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/tracker-entries/timer/stop": {
      "post": {
        "summary": "Stop a timer",
        "operationId": "stopTimer",
        "x-speakeasy-name-override": "stopTimer",
        "description": "Stop the currently running timer or a specific timer entry. Sets the stop timestamp and calculates the elapsed duration. If assignedId is omitted, stops the calling user's timer.\n\nRequired scopes: tracker-entries.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Tracker Timer"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.write"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entryId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Unique identifier of the specific timer entry to stop. If not provided, will stop the current running timer for the user",
                    "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                  },
                  "assignedId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Unique identifier of the user whose timer should be stopped. If not provided, will use the authenticated user",
                    "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  },
                  "stop": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Stop time in ISO 8601 format. If not provided, will use current time",
                    "example": "2024-04-15T17:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Timer stopped successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tracker entry",
                          "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "Date and time when the tracker entry was created in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "duration": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Duration of the timer entry in seconds. -1 indicates running, null for paused, positive number for completed",
                          "example": -1
                        },
                        "start": {
                          "type": "string",
                          "description": "Start time of the tracker entry in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "stop": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Stop time of the tracker entry in ISO 8601 format, null while timer is running",
                          "example": "2024-04-15T17:00:00.000Z"
                        },
                        "teamId": {
                          "type": "string",
                          "description": "Unique identifier of the team that owns this tracker entry",
                          "example": "team-1234"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Description or notes for the tracker entry",
                          "example": "Worked on implementing user authentication feature"
                        },
                        "rate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Hourly rate applied to this tracker entry",
                          "example": 75
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Currency code for the rate in ISO 4217 format",
                          "example": "USD"
                        },
                        "billed": {
                          "type": "boolean",
                          "description": "Whether this tracker entry has been billed to the customer",
                          "example": false
                        },
                        "date": {
                          "type": "string",
                          "description": "Date of the tracker entry in YYYY-MM-DD format",
                          "example": "2024-04-15"
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the user",
                              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                            },
                            "fullName": {
                              "type": "string",
                              "description": "Full name of the user",
                              "example": "Jane Doe"
                            },
                            "avatarUrl": {
                              "type": "string",
                              "description": "URL to the user's avatar image",
                              "example": "https://cdn.eigenn.io/avatar.jpg"
                            }
                          },
                          "required": [
                            "id",
                            "fullName",
                            "avatarUrl"
                          ],
                          "description": "User information for the person who created this tracker entry"
                        },
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the project",
                              "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Date and time when the project was created in ISO 8601 format",
                              "example": "2024-03-01T10:00:00.000Z"
                            },
                            "rate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Default hourly rate for the project",
                              "example": 75
                            },
                            "currency": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Currency code for the project rate in ISO 4217 format",
                              "example": "USD"
                            },
                            "status": {
                              "type": "string",
                              "description": "Current status of the project",
                              "example": "in_progress"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Description of the project",
                              "example": "Complete website redesign with modern UI/UX"
                            },
                            "name": {
                              "type": "string",
                              "description": "Name of the project",
                              "example": "Website Redesign Project"
                            },
                            "billable": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "Whether the project is billable to the customer",
                              "example": true
                            },
                            "estimate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Estimated total hours for the project",
                              "example": 120
                            },
                            "customer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "Unique identifier of the customer",
                                  "example": "customer-1234"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the customer or organization",
                                  "example": "Acme Corporation"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "description": "Customer information associated with the project"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "rate",
                            "currency",
                            "status",
                            "description",
                            "name",
                            "billable",
                            "estimate",
                            "customer"
                          ],
                          "description": "Project information associated with this tracker entry"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "duration",
                        "start",
                        "stop",
                        "teamId",
                        "description",
                        "rate",
                        "currency",
                        "billed",
                        "date",
                        "user",
                        "project"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/tracker-entries/timer/current": {
      "get": {
        "summary": "Get current timer",
        "operationId": "getCurrentTimer",
        "x-speakeasy-name-override": "getCurrentTimer",
        "description": "Get the currently running timer entry for the authenticated user, or null if no timer is active. Use the assignedId query parameter to check another team member's timer.\n\nRequired scopes: tracker-entries.read",
        "tags": [
          "Tracker Timer"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.read"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid",
              "description": "Unique identifier of the user whose current timer should be retrieved. If not provided, will use the authenticated user",
              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
            },
            "required": false,
            "description": "Unique identifier of the user whose current timer should be retrieved. If not provided, will use the authenticated user",
            "name": "assignedId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Current timer retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier of the tracker entry",
                          "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "Date and time when the tracker entry was created in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "duration": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Duration of the timer entry in seconds. -1 indicates running, null for paused, positive number for completed",
                          "example": -1
                        },
                        "start": {
                          "type": "string",
                          "description": "Start time of the tracker entry in ISO 8601 format",
                          "example": "2024-04-15T09:00:00.000Z"
                        },
                        "stop": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Stop time of the tracker entry in ISO 8601 format, null while timer is running",
                          "example": "2024-04-15T17:00:00.000Z"
                        },
                        "teamId": {
                          "type": "string",
                          "description": "Unique identifier of the team that owns this tracker entry",
                          "example": "team-1234"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Description or notes for the tracker entry",
                          "example": "Worked on implementing user authentication feature"
                        },
                        "rate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Hourly rate applied to this tracker entry",
                          "example": 75
                        },
                        "currency": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Currency code for the rate in ISO 4217 format",
                          "example": "USD"
                        },
                        "billed": {
                          "type": "boolean",
                          "description": "Whether this tracker entry has been billed to the customer",
                          "example": false
                        },
                        "date": {
                          "type": "string",
                          "description": "Date of the tracker entry in YYYY-MM-DD format",
                          "example": "2024-04-15"
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the user",
                              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                            },
                            "fullName": {
                              "type": "string",
                              "description": "Full name of the user",
                              "example": "Jane Doe"
                            },
                            "avatarUrl": {
                              "type": "string",
                              "description": "URL to the user's avatar image",
                              "example": "https://cdn.eigenn.io/avatar.jpg"
                            }
                          },
                          "required": [
                            "id",
                            "fullName",
                            "avatarUrl"
                          ],
                          "description": "User information for the person who created this tracker entry"
                        },
                        "project": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "Unique identifier of the project",
                              "example": "b3b6e2c2-1f2a-4e3b-9c1d-2a4b6e2c21f2"
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Date and time when the project was created in ISO 8601 format",
                              "example": "2024-03-01T10:00:00.000Z"
                            },
                            "rate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Default hourly rate for the project",
                              "example": 75
                            },
                            "currency": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Currency code for the project rate in ISO 4217 format",
                              "example": "USD"
                            },
                            "status": {
                              "type": "string",
                              "description": "Current status of the project",
                              "example": "in_progress"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Description of the project",
                              "example": "Complete website redesign with modern UI/UX"
                            },
                            "name": {
                              "type": "string",
                              "description": "Name of the project",
                              "example": "Website Redesign Project"
                            },
                            "billable": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "Whether the project is billable to the customer",
                              "example": true
                            },
                            "estimate": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Estimated total hours for the project",
                              "example": 120
                            },
                            "customer": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "Unique identifier of the customer",
                                  "example": "customer-1234"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the customer or organization",
                                  "example": "Acme Corporation"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "description": "Customer information associated with the project"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "rate",
                            "currency",
                            "status",
                            "description",
                            "name",
                            "billable",
                            "estimate",
                            "customer"
                          ],
                          "description": "Project information associated with this tracker entry"
                        }
                      },
                      "required": [
                        "id",
                        "createdAt",
                        "duration",
                        "start",
                        "stop",
                        "teamId",
                        "description",
                        "rate",
                        "currency",
                        "billed",
                        "date",
                        "user",
                        "project"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tracker-entries/timer/status": {
      "get": {
        "summary": "Get timer status",
        "operationId": "getTimerStatus",
        "x-speakeasy-name-override": "getTimerStatus",
        "description": "Get the timer status with real-time elapsed duration for the authenticated user. Returns whether a timer is running and the computed elapsed seconds, suitable for powering live UI countdowns. Use assignedId to check another team member.\n\nRequired scopes: tracker-entries.read",
        "tags": [
          "Tracker Timer"
        ],
        "x-oppulence-required-scopes": [
          "tracker-entries.read"
        ],
        "security": [
          {
            "oauth2": [
              "tracker-entries.read"
            ]
          },
          {
            "token": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid",
              "description": "Unique identifier of the user whose current timer should be retrieved. If not provided, will use the authenticated user",
              "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
            },
            "required": false,
            "description": "Unique identifier of the user whose current timer should be retrieved. If not provided, will use the authenticated user",
            "name": "assignedId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Timer status retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "isRunning": {
                          "type": "boolean",
                          "description": "Whether there is currently a running timer",
                          "example": true
                        },
                        "currentEntry": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "start": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "projectId": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "trackerProject": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "start",
                            "description",
                            "projectId",
                            "trackerProject"
                          ],
                          "description": "Current running timer details, null if not running"
                        },
                        "elapsedTime": {
                          "type": "number",
                          "description": "Elapsed time in seconds for the current running timer",
                          "example": 1800
                        }
                      },
                      "required": [
                        "isRunning",
                        "currentEntry",
                        "elapsedTime"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/chat": {
      "post": {
        "summary": "Chat",
        "operationId": "createChatResponse",
        "description": "Send a chat message to the AI assistant and receive a streaming response via server-sent events. The stream contains text deltas, tool call events, and source references. Supports optional agent/tool choice overrides, timezone-aware context, and metrics filters. Widget-initiated messages can include forced tool calls that bypass AI routing.\n\nRequired scopes: chat.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "tags": [
          "Chat"
        ],
        "x-oppulence-required-scopes": [
          "chat.write"
        ],
        "security": [
          {
            "oauth2": [
              "chat.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Chat ID",
                    "example": "chat_abc123"
                  },
                  "message": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "user",
                          "assistant",
                          "system"
                        ]
                      },
                      "content": {
                        "type": "string"
                      },
                      "parts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "additionalProperties": {}
                        }
                      },
                      "metadata": {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "required": [
                      "id",
                      "role"
                    ],
                    "additionalProperties": {},
                    "description": "The new message to send to the chat",
                    "example": {
                      "id": "msg_new",
                      "role": "user",
                      "parts": [
                        {
                          "type": "text",
                          "text": "Hello, can you help me with my finances?"
                        }
                      ]
                    }
                  },
                  "assistantMode": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "label": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "id",
                      "label"
                    ],
                    "description": "Assistant mode selected by the user",
                    "example": {
                      "id": "cash",
                      "label": "Cash control"
                    }
                  },
                  "clientContext": {
                    "type": "object",
                    "properties": {
                      "assistantModeId": {
                        "type": "string"
                      },
                      "assistantModeLabel": {
                        "type": "string"
                      },
                      "blocks": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "toolName": {
                              "type": "string",
                              "maxLength": 80
                            }
                          },
                          "required": [
                            "title"
                          ]
                        },
                        "maxItems": 8
                      },
                      "documentId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "documentTitle": {
                        "type": "string",
                        "maxLength": 256
                      },
                      "surface": {
                        "type": "string"
                      },
                      "workflowId": {
                        "type": "string"
                      },
                      "workflowTitle": {
                        "type": "string"
                      }
                    },
                    "description": "Client-provided assistant request context",
                    "example": {
                      "assistantModeId": "collections",
                      "assistantModeLabel": "Collections",
                      "surface": "web",
                      "workflowId": "collections-playbook",
                      "workflowTitle": "Collections playbook"
                    }
                  },
                  "country": {
                    "type": "string",
                    "description": "User's country",
                    "example": "United States"
                  },
                  "city": {
                    "type": "string",
                    "description": "User's city",
                    "example": "San Francisco"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "User's timezone",
                    "example": "America/New_York"
                  },
                  "agentChoice": {
                    "type": "string",
                    "description": "Agent choice",
                    "example": "general"
                  },
                  "toolChoice": {
                    "type": "string",
                    "description": "Tool choice",
                    "example": "getBurnRate"
                  },
                  "metricsFilter": {
                    "type": "object",
                    "properties": {
                      "period": {
                        "type": "string",
                        "description": "Period option (e.g., '1-year', '6-months')"
                      },
                      "from": {
                        "type": "string",
                        "description": "Start date in yyyy-MM-dd format"
                      },
                      "to": {
                        "type": "string",
                        "description": "End date in yyyy-MM-dd format"
                      },
                      "currency": {
                        "type": "string",
                        "description": "Currency code (e.g., 'USD')"
                      },
                      "revenueType": {
                        "type": "string",
                        "enum": [
                          "gross",
                          "net"
                        ],
                        "description": "Revenue type for calculations"
                      }
                    },
                    "required": [
                      "period",
                      "from",
                      "to",
                      "revenueType"
                    ],
                    "description": "Current dashboard metrics filter state - tools use this as default",
                    "example": {
                      "period": "1-year",
                      "from": "2025-01-21",
                      "to": "2026-01-21",
                      "currency": "USD",
                      "revenueType": "net"
                    }
                  },
                  "mentionedApps": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1
                        },
                        "slug": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "name",
                        "slug"
                      ],
                      "description": "Connected app explicitly mentioned or selected for this assistant request",
                      "example": {
                        "name": "Gmail",
                        "slug": "gmail"
                      }
                    },
                    "maxItems": 10,
                    "description": "Connected apps explicitly mentioned or selected for this request"
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "data": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "type",
                        "data"
                      ]
                    },
                    "description": "Files to send to the chat",
                    "example": [
                      {
                        "name": "example.pdf",
                        "type": "application/pdf",
                        "data": "base64encodeddata"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Streaming chat response.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ChatStreamResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/transcription": {
      "post": {
        "description": "Transcribe a base64-encoded audio payload into text using OpenAI Whisper. Returns the transcribed text, detected language, and audio duration in seconds. Supports common audio MIME types (audio/wav, audio/mpeg, audio/webm, etc.).\n\nRequired scopes: chat.write\n\nAuthenticated write operations support optional `Idempotency-Key` replay semantics.",
        "operationId": "transcribeAudio",
        "summary": "Transcribe Audio",
        "tags": [
          "Chat"
        ],
        "x-oppulence-required-scopes": [
          "chat.write"
        ],
        "security": [
          {
            "oauth2": [
              "chat.write"
            ]
          },
          {
            "token": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "audio": {
                    "type": "string",
                    "description": "Base64 encoded audio data",
                    "example": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA..."
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "MIME type of the audio file",
                    "example": "audio/webm"
                  }
                },
                "required": [
                  "audio",
                  "mimeType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful transcription result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Whether the transcription succeeded",
                      "example": true
                    },
                    "text": {
                      "type": "string",
                      "description": "Transcribed text",
                      "example": "Please send the updated invoice this afternoon."
                    },
                    "language": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Detected language, when available",
                      "example": "en"
                    },
                    "durationInSeconds": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Audio duration in seconds, when available",
                      "example": 12.4
                    }
                  },
                  "required": [
                    "success",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid input, missing fields, or malformed parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. Missing or invalid credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. Authenticated but lacking required permissions or scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found. The resource does not exist or is not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict. The request conflicts with current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. The request payload is structurally invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    }
  },
  "webhooks": {}
}
