{
  "components": {
    "schemas": {
      "AccountOrderCommandRequest": {
        "description": "Account-scoped order command body for place and modify.",
        "properties": {
          "broker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional broker id hint for schema discrimination; must match the account grant when provided.",
            "title": "Broker"
          },
          "order": {
            "additionalProperties": true,
            "description": "Broker-specific order payload",
            "title": "Order",
            "type": "object"
          },
          "paperTradeConfirmed": {
            "default": false,
            "description": "Explicit per-operation confirmation for paper-trading writes. Public sandbox orders are rejected unless this is true.",
            "title": "Papertradeconfirmed",
            "type": "boolean"
          }
        },
        "required": [
          "order"
        ],
        "title": "AccountOrderCommandRequest",
        "type": "object"
      },
      "BrokerConnectionRequest": {
        "description": "Request model for creating a broker connection.\n\nThis model represents the request payload for creating a new broker connection\nor reconnecting to an existing one. Used by the POST /connections endpoint to\nauthenticate with a broker and establish a connection that can be shared across\ncompany accounts.\n\nThe model includes broker identification, authentication credentials, optional\npermission settings, and an optional connection ID for reconnection scenarios.\n\nAttributes\n----------\nbroker_id : str\n    Unique identifier for the broker (e.g., \"tradestation\", \"tasty_trade\").\n    Must match a broker ID from the available brokers list. Determines which\n    broker adapter handles the connection.\ncredentials : dict\n    Authentication credentials required by the broker. Structure varies by\n    broker and auth_type. Common formats include:\n    - OAuth: {\"access_token\": \"...\", \"refresh_token\": \"...\"}\n    - API Key: {\"api_key\": \"...\", \"api_secret\": \"...\"}\n    - Username/Password: {\"username\": \"...\", \"password\": \"...\"}\npermissions : BrokerPermissions | None\n    Initial permission settings for the connection. If None, defaults to\n    read-only access (read=True, write=False). Can be updated later via\n    BrokerConnectionUpdateRequest.\nconnection_id : UUID | None\n    Optional connection ID for reconnection scenarios. If provided, the system\n    attempts to reconnect to an existing connection rather than creating a\n    new one. Used when refreshing expired tokens or restoring connections.\n    Default is None (create new connection).\n\nNotes\n-----\n1. **Credential Format**: The credentials dict structure is broker-specific.\n   Each broker adapter validates credentials according to its requirements.\n\n2. **Reconnection**: When connection_id is provided, the system validates\n   that the connection exists and belongs to the user before reconnecting.\n\n3. **Multi-Step Auth**: Some brokers require multi-step authentication flows\n   (OAuth). In these cases, the initial request may return a MultiStepAuthResponse\n   instead of a BrokerDataUserBrokerConnections object.\n\n4. **Company Sharing**: Once created, connections can be shared with company\n   accounts via the CompanyAccess table with specific permissions per company.\n\nExamples\n--------\n>>> # Create new connection with API key\n>>> request = BrokerConnectionRequest(\n...     broker_id=\"tradestation\",\n...     credentials={\n...         \"api_key\": \"your_api_key\",\n...         \"api_secret\": \"your_api_secret\",\n...     },\n...     permissions=BrokerPermissions(read=True, write=True),\n... )\n>>> # Reconnect to existing connection\n>>> reconnect_request = BrokerConnectionRequest(\n...     broker_id=\"tasty_trade\",\n...     credentials={\"refresh_token\": \"token_here\"},\n...     connection_id=UUID(\"123e4567-e89b-12d3-a456-426614174000\"),\n... )\n>>> # OAuth connection (may require multi-step flow)\n>>> oauth_request = BrokerConnectionRequest(\n...     broker_id=\"interactive_brokers\",\n...     credentials={\"code\": \"oauth_code_from_callback\"},\n... )\n\nSee Also\n--------\nBrokerPermissions : Permission model used in this request\nBrokerConnectionUpdateRequest : Model for updating existing connections\nfinaticapi.api.beta.routers.brokers.legacy.legacy_brokers_router.create_connection\n    : Endpoint that accepts this model\nfinaticapi.core.services.broker_service.BrokerService.create_connection\n    : Service method that processes this request",
        "properties": {
          "broker_id": {
            "title": "Broker Id",
            "type": "string"
          },
          "connection_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Id"
          },
          "create_new_connection": {
            "default": false,
            "title": "Create New Connection",
            "type": "boolean"
          },
          "credentials": {
            "additionalProperties": true,
            "title": "Credentials",
            "type": "object"
          },
          "permissions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BrokerPermissions"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "broker_id",
          "credentials"
        ],
        "title": "BrokerConnectionRequest",
        "type": "object"
      },
      "BrokerPermissions": {
        "description": "Broker permissions model.\n\nThis model defines the permission levels for accessing broker connection data\nand performing trading operations. Used in BrokerConnectionRequest and\nBrokerConnectionUpdateRequest to specify what actions a company account can\nperform with a broker connection.\n\nPermissions are stored in the CompanyAccess table and control access at the\ncompany level, allowing fine-grained control over which companies can read\ndata versus execute trades.\n\nAttributes\n----------\nread : bool\n    Whether the company has permission to read broker data including positions,\n    orders, account information, and market data. Default is True. When False,\n    the company cannot access any broker data through this connection.\nwrite : bool\n    Whether the company has permission to place trades, modify orders, and\n    perform other write operations. Default is False. When True, the company\n    can execute trading operations through this broker connection.\n\nNotes\n-----\n1. **Permission Combinations**:\n   - read=True, write=False: Read-only access (view positions, orders, accounts)\n   - read=True, write=True: Full access (read data and execute trades)\n   - read=False, write=False: No access (connection effectively disabled for company)\n   - read=False, write=True: Invalid combination (write requires read access)\n\n2. **Default Behavior**: By default, connections grant read-only access. Write\n   permissions must be explicitly enabled.\n\n3. **Company-Level Control**: Permissions are scoped to individual company\n   accounts. The same broker connection can have different permissions for\n   different companies.\n\n4. **Security**: Write permissions enable trading operations. Use with caution\n   and ensure proper authorization checks are in place.\n\nExamples\n--------\n>>> # Read-only permissions (default)\n>>> read_only = BrokerPermissions(read=True, write=False)\n>>> # Full trading access\n>>> full_access = BrokerPermissions(read=True, write=True)\n>>> # Explicit read-only (same as default)\n>>> explicit_read_only = BrokerPermissions()\n>>> # Use in connection request\n>>> request = BrokerConnectionRequest(\n...     broker_id=\"tradestation\",\n...     credentials={\"api_key\": \"xxx\"},\n...     permissions=BrokerPermissions(read=True, write=True),\n... )\n\nSee Also\n--------\nBrokerConnectionRequest : Request model that includes permissions\nBrokerConnectionUpdateRequest : Update request model that can modify permissions\nfinaticapi.core.services.broker_service.BrokerService : Service methods that enforce permissions",
        "properties": {
          "read": {
            "default": true,
            "description": "Access to read data (positions, orders, accounts)",
            "title": "Read",
            "type": "boolean"
          },
          "write": {
            "default": false,
            "description": "Access to place trades",
            "title": "Write",
            "type": "boolean"
          }
        },
        "title": "BrokerPermissions",
        "type": "object"
      },
      "CreateSessionRequest": {
        "description": "Create-session request.",
        "properties": {
          "deviceInfo": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deviceinfo"
          }
        },
        "title": "CreateSessionRequest",
        "type": "object"
      },
      "FDXAccountGrant": {
        "description": "Public account-grant resource.",
        "properties": {
          "brokerAccountId": {
            "title": "Brokeraccountid",
            "type": "string"
          },
          "brokerId": {
            "title": "Brokerid",
            "type": "string"
          },
          "canRead": {
            "title": "Canread",
            "type": "boolean"
          },
          "canTrade": {
            "title": "Cantrade",
            "type": "boolean"
          },
          "companyAccountId": {
            "title": "Companyaccountid",
            "type": "string"
          },
          "consentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consentid"
          },
          "consentedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consentedat"
          },
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdat"
          },
          "dataClusters": {
            "items": {
              "type": "string"
            },
            "title": "Dataclusters",
            "type": "array"
          },
          "expiresAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiresat"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "lookbackDays": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lookbackdays"
          },
          "revokedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revokedat"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "updatedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updatedat"
          }
        },
        "required": [
          "id",
          "companyAccountId",
          "brokerAccountId",
          "brokerId",
          "status",
          "canRead",
          "canTrade"
        ],
        "title": "FDXAccountGrant",
        "type": "object"
      },
      "FDXAccountGrantUpdate": {
        "description": "Mutable account-grant fields.",
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "canRead": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Canread"
          },
          "canTrade": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cantrade"
          },
          "dataClusters": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataclusters"
          },
          "expiresAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiresat"
          }
        },
        "title": "FDXAccountGrantUpdate",
        "type": "object"
      },
      "FDXBrokerOrder": {},
      "FDXBrokerOrderCommandResult": {
        "description": "Result of an account-scoped order command (place, modify, or cancel).\n\nThe ``order`` field uses the same FDX public shape as ``GET /accounts/{id}/orders``.\n\nNotes\n-----\nCamelCase fields that differ from the Python name must use ``alias=`` (not\nonly ``serialization_alias``). Account-grant handlers often return a\ncamelCase public dict that ``FinaticResponse[FDXBrokerOrderCommandResult]``\nre-validates; serialization-only aliases are dropped on that pass.",
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "accepted": {
            "description": "Whether the broker accepted the command.",
            "title": "Accepted",
            "type": "boolean"
          },
          "action": {
            "description": "Command that was executed.",
            "enum": [
              "PLACE",
              "MODIFY",
              "CANCEL"
            ],
            "title": "Action",
            "type": "string"
          },
          "clientOrderId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Client reference from Idempotency-Key.",
            "title": "Clientorderid"
          },
          "executionStrategy": {
            "anyOf": [
              {
                "enum": [
                  "NATIVE_MODIFY",
                  "CANCEL_REPLACE",
                  "ASYNC_COMMAND"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How modify was executed when applicable.",
            "title": "Executionstrategy"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable broker or Finatic message.",
            "title": "Message"
          },
          "order": {
            "$ref": "#/components/schemas/FDXBrokerOrder",
            "description": "Persisted order snapshot from integration.orders."
          },
          "supersededOrderId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prior Finatic order id after cancel-replace modify.",
            "title": "Supersededorderid"
          }
        },
        "required": [
          "action",
          "accepted",
          "order"
        ],
        "title": "FDXBrokerOrderCommandResult",
        "type": "object",
        "x-fdx-extension": "broker-trading"
      },
      "FDXWebhookEventDefinition": {
        "description": "Public webhook event catalog entry.",
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "category": {
            "title": "Category",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "environments": {
            "items": {
              "enum": [
                "live",
                "sandbox"
              ],
              "type": "string"
            },
            "title": "Environments",
            "type": "array"
          },
          "eventType": {
            "title": "Eventtype",
            "type": "string"
          }
        },
        "required": [
          "eventType",
          "category",
          "description"
        ],
        "title": "FDXWebhookEventDefinition",
        "type": "object"
      },
      "FDXWebhookSubscription": {
        "description": "Public webhook subscription resource.",
        "properties": {
          "createdAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdat"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "environment": {
            "default": "live",
            "enum": [
              "live",
              "sandbox"
            ],
            "title": "Environment",
            "type": "string"
          },
          "eventTypes": {
            "items": {
              "type": "string"
            },
            "title": "Eventtypes",
            "type": "array"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "status": {
            "default": "active",
            "enum": [
              "active",
              "disabled",
              "revoked"
            ],
            "title": "Status",
            "type": "string"
          },
          "updatedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updatedat"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url"
        ],
        "title": "FDXWebhookSubscription",
        "type": "object"
      },
      "FDXWebhookSubscriptionCreate": {
        "description": "Create a webhook subscription for customer event delivery.",
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "environment": {
            "default": "live",
            "enum": [
              "live",
              "sandbox"
            ],
            "title": "Environment",
            "type": "string"
          },
          "eventTypes": {
            "items": {
              "enum": [
                "account.grant.created",
                "account.grant.updated",
                "account.grant.revoked",
                "account.sync.started",
                "account.sync.succeeded",
                "account.sync.failed",
                "account.balance.updated",
                "account.position.updated",
                "account.transaction.created",
                "order.created",
                "order.updated",
                "order.filled",
                "order.cancelled",
                "order.rejected",
                "connection.reauth.required"
              ],
              "type": "string"
            },
            "minItems": 1,
            "title": "Eventtypes",
            "type": "array"
          },
          "url": {
            "format": "uri",
            "maxLength": 2083,
            "minLength": 1,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "eventTypes"
        ],
        "title": "FDXWebhookSubscriptionCreate",
        "type": "object"
      },
      "FDXWebhookSubscriptionUpdate": {
        "description": "Mutable webhook subscription fields.",
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "eventTypes": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "account.grant.created",
                    "account.grant.updated",
                    "account.grant.revoked",
                    "account.sync.started",
                    "account.sync.succeeded",
                    "account.sync.failed",
                    "account.balance.updated",
                    "account.position.updated",
                    "account.transaction.created",
                    "order.created",
                    "order.updated",
                    "order.filled",
                    "order.cancelled",
                    "order.rejected",
                    "connection.reauth.required"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eventtypes"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "disabled",
                  "revoked"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "url": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "title": "FDXWebhookSubscriptionUpdate",
        "type": "object"
      },
      "FinaticAPIErrorResponse": {
        "description": "Error response schema for OpenAPI documentation.\n\nErrors include rich domain-specific codes (e.g., ORDER_NOT_FOUND, TRADE_ACCESS_DENIED)\nmapped to standardized types and HTTP status codes via ERROR_CODE_REGISTRY.",
        "properties": {
          "error": {
            "additionalProperties": true,
            "description": "Error details with type (FinaticErrorType), code (domain-specific), message (human-readable), status (HTTP status code), and optional details. Error codes are mapped via ERROR_CODE_REGISTRY - see registry for available codes.",
            "examples": [
              {
                "code": "ORDER_NOT_FOUND",
                "details": {
                  "order_id": "abc123",
                  "suggestion": "Verify the order_id is correct"
                },
                "message": "Order not found with broker order ID: abc123",
                "status": 404,
                "type": "DOMAIN"
              },
              {
                "code": "TRADE_ACCESS_DENIED",
                "details": {
                  "company_id": "123",
                  "connection_id": "456"
                },
                "message": "Trade access denied: Company does not have trade permission",
                "status": 403,
                "type": "AUTH"
              }
            ],
            "title": "Error",
            "type": "object"
          },
          "success": {
            "additionalProperties": true,
            "description": "Success payload with data=None for errors",
            "examples": [
              {}
            ],
            "title": "Success",
            "type": "object"
          },
          "trace_id": {
            "description": "Request trace identifier for tracking and debugging",
            "title": "Trace Id",
            "type": "string"
          }
        },
        "required": [
          "trace_id",
          "success",
          "error"
        ],
        "title": "FinaticAPIErrorResponse",
        "type": "object"
      },
      "FinaticEnvironment": {
        "description": "Finatic execution environment. live uses real broker I/O; sandbox uses Finatic synthetic/mock partner data.",
        "enum": [
          "live",
          "sandbox"
        ],
        "type": "string"
      },
      "FinaticResponse_Any_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_Any_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[Any]",
        "type": "object"
      },
      "FinaticResponse_FDXAccountGrant_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_FDXAccountGrant_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[FDXAccountGrant]",
        "type": "object"
      },
      "FinaticResponse_FDXBrokerOrderCommandResult_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_FDXBrokerOrderCommandResult_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[FDXBrokerOrderCommandResult]",
        "type": "object"
      },
      "FinaticResponse_FDXWebhookSubscription_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_FDXWebhookSubscription_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[FDXWebhookSubscription]",
        "type": "object"
      },
      "FinaticResponse_OwnerPortalBootstrapResponse_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_OwnerPortalBootstrapResponse_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[OwnerPortalBootstrapResponse]",
        "type": "object"
      },
      "FinaticResponse_OwnerPortalRevokeAllCompaniesResult_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_OwnerPortalRevokeAllCompaniesResult_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[OwnerPortalRevokeAllCompaniesResult]",
        "type": "object"
      },
      "FinaticResponse_PortalUrlResponse_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_PortalUrlResponse_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[PortalUrlResponse]",
        "type": "object"
      },
      "FinaticResponse_ReauthNotificationOptOutResult_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_ReauthNotificationOptOutResult_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[ReauthNotificationOptOutResult]",
        "type": "object"
      },
      "FinaticResponse_ReauthNotificationPreference_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_ReauthNotificationPreference_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[ReauthNotificationPreference]",
        "type": "object"
      },
      "FinaticResponse_SessionResponseData_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_SessionResponseData_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[SessionResponseData]",
        "type": "object"
      },
      "FinaticResponse_SessionSyncStatusResponse_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_SessionSyncStatusResponse_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[SessionSyncStatusResponse]",
        "type": "object"
      },
      "FinaticResponse_SessionUserResponse_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_SessionUserResponse_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[SessionUserResponse]",
        "type": "object"
      },
      "FinaticResponse_TokenResponseData_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_TokenResponseData_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[TokenResponseData]",
        "type": "object"
      },
      "FinaticResponse_UserOffboardingResult_": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_UserOffboardingResult_"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[UserOffboardingResult]",
        "type": "object"
      },
      "FinaticResponse_dict_str__Any__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_dict_str__Any__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[dict[str, Any]]",
        "type": "object"
      },
      "FinaticResponse_dict_str__Union_str__NoneType___": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_dict_str__Union_str__NoneType___"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[dict[str, Union[str, NoneType]]]",
        "type": "object"
      },
      "FinaticResponse_dict_str__object__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_dict_str__object__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[dict[str, object]]",
        "type": "object"
      },
      "FinaticResponse_dict_str__str__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_dict_str__str__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[dict[str, str]]",
        "type": "object"
      },
      "FinaticResponse_list_FDXAccountGrant__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_list_FDXAccountGrant__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[list[FDXAccountGrant]]",
        "type": "object"
      },
      "FinaticResponse_list_FDXWebhookEventDefinition__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_list_FDXWebhookEventDefinition__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[list[FDXWebhookEventDefinition]]",
        "type": "object"
      },
      "FinaticResponse_list_FDXWebhookSubscription__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_list_FDXWebhookSubscription__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[list[FDXWebhookSubscription]]",
        "type": "object"
      },
      "FinaticResponse_list_OwnerPortalAccountGrant__": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_list_OwnerPortalAccountGrant__"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[list[OwnerPortalAccountGrant]]",
        "type": "object"
      },
      "FinaticResponse_list_dict_str__Any___": {
        "properties": {
          "error": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional error object with message, code, status, and details",
            "title": "Error"
          },
          "success": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SuccessPayload_list_dict_str__Any___"
              },
              {
                "type": "null"
              }
            ],
            "description": "Success payload containing data and optional meta. None when error is present."
          },
          "trace_id": {
            "default": "",
            "description": "Request trace identifier for tracking and debugging. Auto-generated if not provided.",
            "title": "Trace Id",
            "type": "string"
          },
          "warning": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional array of warning objects",
            "title": "Warning"
          }
        },
        "title": "FinaticResponse[list[dict[str, Any]]]",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "OwnerPortalAccountGrant": {
        "description": "One FDX account grant on an owner-owned connection, for manage UI.",
        "properties": {
          "account_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Display Name"
          },
          "account_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Kind"
          },
          "account_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Number"
          },
          "broker_account_id": {
            "format": "uuid",
            "title": "Broker Account Id",
            "type": "string"
          },
          "broker_id": {
            "title": "Broker Id",
            "type": "string"
          },
          "can_read": {
            "title": "Can Read",
            "type": "boolean"
          },
          "can_trade": {
            "title": "Can Trade",
            "type": "boolean"
          },
          "company_account_id": {
            "format": "uuid",
            "title": "Company Account Id",
            "type": "string"
          },
          "company_name": {
            "title": "Company Name",
            "type": "string"
          },
          "consent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Consent Id"
          },
          "data_clusters": {
            "items": {
              "type": "string"
            },
            "title": "Data Clusters",
            "type": "array"
          },
          "grant_id": {
            "format": "uuid",
            "title": "Grant Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "grant_id",
          "company_account_id",
          "company_name",
          "broker_account_id",
          "broker_id",
          "status",
          "can_read",
          "can_trade"
        ],
        "title": "OwnerPortalAccountGrant",
        "type": "object"
      },
      "OwnerPortalAccountGrantUpdate": {
        "additionalProperties": false,
        "description": "Owner-portal update for one account grant's resource clusters.",
        "properties": {
          "canRead": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Canread"
          },
          "canTrade": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cantrade"
          },
          "dataClusters": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataclusters"
          }
        },
        "title": "OwnerPortalAccountGrantUpdate",
        "type": "object"
      },
      "OwnerPortalBootstrapResponse": {
        "description": "Bootstrap payload after Supabase OTP in owner portal mode.",
        "properties": {
          "connections": {
            "items": {
              "$ref": "#/components/schemas/OwnerPortalConnection"
            },
            "title": "Connections",
            "type": "array"
          },
          "known_companies": {
            "items": {
              "$ref": "#/components/schemas/OwnerPortalKnownCompany"
            },
            "title": "Known Companies",
            "type": "array"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "title": "OwnerPortalBootstrapResponse",
        "type": "object"
      },
      "OwnerPortalCompanyGrant": {
        "description": "Per-connection view of access for one company.",
        "properties": {
          "company_id": {
            "format": "uuid",
            "title": "Company Id",
            "type": "string"
          },
          "has_access": {
            "default": false,
            "title": "Has Access",
            "type": "boolean"
          },
          "permissions": {
            "additionalProperties": {
              "type": "boolean"
            },
            "title": "Permissions",
            "type": "object"
          }
        },
        "required": [
          "company_id"
        ],
        "title": "OwnerPortalCompanyGrant",
        "type": "object"
      },
      "OwnerPortalCompanyPermissionsUpdate": {
        "description": "Update read/write for one company on one connection.",
        "properties": {
          "read": {
            "title": "Read",
            "type": "boolean"
          },
          "write": {
            "title": "Write",
            "type": "boolean"
          }
        },
        "required": [
          "read",
          "write"
        ],
        "title": "OwnerPortalCompanyPermissionsUpdate",
        "type": "object"
      },
      "OwnerPortalConnection": {
        "description": "Broker connection with merged company grant rows for owner UI.",
        "properties": {
          "broker_id": {
            "title": "Broker Id",
            "type": "string"
          },
          "company_grants": {
            "items": {
              "$ref": "#/components/schemas/OwnerPortalCompanyGrant"
            },
            "title": "Company Grants",
            "type": "array"
          },
          "connection_metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Metadata"
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_synced_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Synced At"
          },
          "needs_reauth": {
            "default": false,
            "title": "Needs Reauth",
            "type": "boolean"
          },
          "push_agent_connector_state": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Push Agent Connector State"
          },
          "push_agent_last_heartbeat_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Push Agent Last Heartbeat At"
          },
          "requires_customer_agent": {
            "default": false,
            "title": "Requires Customer Agent",
            "type": "boolean"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "broker_id"
        ],
        "title": "OwnerPortalConnection",
        "type": "object"
      },
      "OwnerPortalKnownCompany": {
        "description": "Company (account) that appears in the user's union of granted access.",
        "properties": {
          "company_id": {
            "format": "uuid",
            "title": "Company Id",
            "type": "string"
          },
          "company_name": {
            "title": "Company Name",
            "type": "string"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url"
          },
          "trading_enabled": {
            "default": false,
            "title": "Trading Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "company_id",
          "company_name"
        ],
        "title": "OwnerPortalKnownCompany",
        "type": "object"
      },
      "OwnerPortalRevokeAllCompaniesResult": {
        "description": "Result of revoking every company grant on a connection.",
        "properties": {
          "connection_id": {
            "format": "uuid",
            "title": "Connection Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "revoked_company_count": {
            "title": "Revoked Company Count",
            "type": "integer"
          }
        },
        "required": [
          "connection_id",
          "revoked_company_count",
          "message"
        ],
        "title": "OwnerPortalRevokeAllCompaniesResult",
        "type": "object"
      },
      "PortalUrlResponse": {
        "description": "Response model for portal URL.",
        "properties": {
          "portal_url": {
            "description": "Portal URL with token",
            "title": "Portal Url",
            "type": "string"
          }
        },
        "required": [
          "portal_url"
        ],
        "title": "PortalUrlResponse",
        "type": "object"
      },
      "ReauthNotificationOptOutRequest": {
        "description": "Request body for applying a reauth email opt-out token.",
        "properties": {
          "token": {
            "description": "High-entropy opt-out token from the reauth email link.",
            "minLength": 32,
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "title": "ReauthNotificationOptOutRequest",
        "type": "object"
      },
      "ReauthNotificationOptOutResult": {
        "description": "Sanitized result for a reauth email opt-out token application.",
        "properties": {
          "email_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Effective email notification state after opt-out.",
            "title": "Email Enabled"
          },
          "preference_updated": {
            "default": false,
            "description": "Whether the stored preference was updated.",
            "title": "Preference Updated",
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sanitized non-secret failure or status reason.",
            "title": "Reason"
          },
          "status": {
            "description": "One of success, expired, invalid, or error.",
            "title": "Status",
            "type": "string"
          },
          "user_broker_connection_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Connection updated when the token was valid.",
            "title": "User Broker Connection Id"
          }
        },
        "required": [
          "status"
        ],
        "title": "ReauthNotificationOptOutResult",
        "type": "object"
      },
      "ReauthNotificationPreference": {
        "description": "Per-connection reauth email notification preference state.",
        "properties": {
          "email_enabled": {
            "description": "Effective email notification preference for reauth events.",
            "title": "Email Enabled",
            "type": "boolean"
          },
          "is_default": {
            "description": "True when no explicit preference row has been saved.",
            "title": "Is Default",
            "type": "boolean"
          },
          "last_delivery_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most recent reauth notification delivery row timestamp.",
            "title": "Last Delivery At"
          },
          "last_delivery_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most recent delivery status recorded by Background.",
            "title": "Last Delivery Status"
          },
          "last_notified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Most recent reauth notification timestamp.",
            "title": "Last Notified At"
          },
          "opted_out_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Timestamp when email notification was opted out.",
            "title": "Opted Out At"
          },
          "preference_source": {
            "description": "Source of the current preference value.",
            "title": "Preference Source",
            "type": "string"
          },
          "user_broker_connection_id": {
            "format": "uuid",
            "title": "User Broker Connection Id",
            "type": "string"
          }
        },
        "required": [
          "user_broker_connection_id",
          "email_enabled",
          "is_default",
          "preference_source"
        ],
        "title": "ReauthNotificationPreference",
        "type": "object"
      },
      "ReauthNotificationPreferenceUpdateRequest": {
        "description": "Request body for updating a per-connection reauth email preference.",
        "properties": {
          "email_enabled": {
            "description": "Whether reauth email notifications should be enabled.",
            "title": "Email Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "email_enabled"
        ],
        "title": "ReauthNotificationPreferenceUpdateRequest",
        "type": "object"
      },
      "SessionResponseData": {
        "description": "Response data for session operations.",
        "example": {},
        "properties": {
          "company_id": {
            "description": "Company ID",
            "title": "Company Id",
            "type": "string"
          },
          "expires_at": {
            "description": "Session expiration time",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "portal_connection_management_pending": {
            "default": false,
            "description": "True when a valid provisional user_id was applied: trading/data may proceed, but portal connection-management still requires link-user / OTP step-up.",
            "title": "Portal Connection Management Pending",
            "type": "boolean"
          },
          "provided_user_id_rejected": {
            "default": false,
            "description": "True when a provisional user_id was supplied on start but was not applied (invalid UUID or no broker connection with company access for this company).",
            "title": "Provided User Id Rejected",
            "type": "boolean"
          },
          "session_id": {
            "description": "Session ID",
            "title": "Session Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/SessionStatus",
            "description": "Session status"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User ID if authenticated",
            "title": "User Id"
          }
        },
        "required": [
          "session_id",
          "company_id",
          "status",
          "expires_at"
        ],
        "title": "SessionResponseData",
        "type": "object"
      },
      "SessionStartRequest": {
        "description": "Request model for session start.",
        "properties": {
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional user ID to associate with session",
            "title": "User Id"
          }
        },
        "title": "SessionStartRequest",
        "type": "object"
      },
      "SessionStatus": {
        "description": "Status of a session.",
        "enum": [
          "pending",
          "authenticating",
          "active",
          "completed",
          "expired"
        ],
        "title": "SessionStatus",
        "type": "string"
      },
      "SessionSyncAccountStatus": {
        "additionalProperties": false,
        "description": "Public sync status for one granted account in a session.",
        "properties": {
          "accountId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accountid"
          },
          "brokerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brokerid"
          },
          "lastSyncedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lastsyncedat"
          },
          "providerHealth": {
            "default": "healthy",
            "title": "Providerhealth",
            "type": "string"
          },
          "syncError": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Syncerror"
          },
          "syncStatus": {
            "title": "Syncstatus",
            "type": "string"
          }
        },
        "required": [
          "syncStatus"
        ],
        "title": "SessionSyncAccountStatus",
        "type": "object"
      },
      "SessionSyncStatusResponse": {
        "additionalProperties": false,
        "description": "Pollable session sync status for the selected-account flow.",
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/SessionSyncAccountStatus"
            },
            "title": "Accounts",
            "type": "array"
          },
          "companyId": {
            "title": "Companyid",
            "type": "string"
          },
          "sessionId": {
            "title": "Sessionid",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "sessionId",
          "companyId",
          "status",
          "accounts"
        ],
        "title": "SessionSyncStatusResponse",
        "type": "object"
      },
      "SessionUserResponse": {
        "description": "Response model for session user information.",
        "example": {},
        "properties": {
          "user_id": {
            "description": "User ID",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id"
        ],
        "title": "SessionUserResponse",
        "type": "object"
      },
      "SuccessPayload_Any_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[Any]",
        "type": "object"
      },
      "SuccessPayload_FDXAccountGrant_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FDXAccountGrant"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[FDXAccountGrant]",
        "type": "object"
      },
      "SuccessPayload_FDXBrokerOrderCommandResult_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FDXBrokerOrderCommandResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[FDXBrokerOrderCommandResult]",
        "type": "object"
      },
      "SuccessPayload_FDXWebhookSubscription_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FDXWebhookSubscription"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[FDXWebhookSubscription]",
        "type": "object"
      },
      "SuccessPayload_OwnerPortalBootstrapResponse_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OwnerPortalBootstrapResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[OwnerPortalBootstrapResponse]",
        "type": "object"
      },
      "SuccessPayload_OwnerPortalRevokeAllCompaniesResult_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OwnerPortalRevokeAllCompaniesResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[OwnerPortalRevokeAllCompaniesResult]",
        "type": "object"
      },
      "SuccessPayload_PortalUrlResponse_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PortalUrlResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[PortalUrlResponse]",
        "type": "object"
      },
      "SuccessPayload_ReauthNotificationOptOutResult_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReauthNotificationOptOutResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[ReauthNotificationOptOutResult]",
        "type": "object"
      },
      "SuccessPayload_ReauthNotificationPreference_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReauthNotificationPreference"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[ReauthNotificationPreference]",
        "type": "object"
      },
      "SuccessPayload_SessionResponseData_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionResponseData"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[SessionResponseData]",
        "type": "object"
      },
      "SuccessPayload_SessionSyncStatusResponse_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionSyncStatusResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[SessionSyncStatusResponse]",
        "type": "object"
      },
      "SuccessPayload_SessionUserResponse_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SessionUserResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[SessionUserResponse]",
        "type": "object"
      },
      "SuccessPayload_TokenResponseData_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenResponseData"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[TokenResponseData]",
        "type": "object"
      },
      "SuccessPayload_UserOffboardingResult_": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserOffboardingResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[UserOffboardingResult]",
        "type": "object"
      },
      "SuccessPayload_dict_str__Any__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[dict[str, Any]]",
        "type": "object"
      },
      "SuccessPayload_dict_str__Union_str__NoneType___": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[dict[str, Union[str, NoneType]]]",
        "type": "object"
      },
      "SuccessPayload_dict_str__object__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[dict[str, object]]",
        "type": "object"
      },
      "SuccessPayload_dict_str__str__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[dict[str, str]]",
        "type": "object"
      },
      "SuccessPayload_list_FDXAccountGrant__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FDXAccountGrant"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[list[FDXAccountGrant]]",
        "type": "object"
      },
      "SuccessPayload_list_FDXWebhookEventDefinition__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FDXWebhookEventDefinition"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[list[FDXWebhookEventDefinition]]",
        "type": "object"
      },
      "SuccessPayload_list_FDXWebhookSubscription__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/FDXWebhookSubscription"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[list[FDXWebhookSubscription]]",
        "type": "object"
      },
      "SuccessPayload_list_OwnerPortalAccountGrant__": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/OwnerPortalAccountGrant"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[list[OwnerPortalAccountGrant]]",
        "type": "object"
      },
      "SuccessPayload_list_dict_str__Any___": {
        "properties": {
          "_id": {
            "title": "Id",
            "type": "string"
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "The response data (None when error is present)",
            "title": "Data"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional metadata (pagination, etc.)",
            "title": "Meta"
          }
        },
        "title": "SuccessPayload[list[dict[str, Any]]]",
        "type": "object"
      },
      "TokenResponseData": {
        "description": "Response data for token operations.",
        "example": {},
        "properties": {
          "expires_at": {
            "description": "Token expiration time",
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "one_time_token": {
            "description": "One-time use token",
            "title": "One Time Token",
            "type": "string"
          }
        },
        "required": [
          "one_time_token",
          "expires_at"
        ],
        "title": "TokenResponseData",
        "type": "object"
      },
      "UserOffboardingConnectionResult": {
        "description": "Tenant-safe result for one affected broker connection.",
        "properties": {
          "action": {
            "enum": [
              "company_grants_revoked",
              "connection_deletion_started"
            ],
            "title": "Action",
            "type": "string"
          },
          "connection_id": {
            "format": "uuid",
            "title": "Connection Id",
            "type": "string"
          },
          "disconnect_operation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disconnect Operation Id"
          },
          "revoked_grant_count": {
            "minimum": 0.0,
            "title": "Revoked Grant Count",
            "type": "integer"
          }
        },
        "required": [
          "connection_id",
          "action",
          "revoked_grant_count"
        ],
        "title": "UserOffboardingConnectionResult",
        "type": "object"
      },
      "UserOffboardingResult": {
        "description": "Aggregate outcome for an idempotent user offboarding operation.",
        "properties": {
          "aggregate_operation_id": {
            "format": "uuid",
            "title": "Aggregate Operation Id",
            "type": "string"
          },
          "connection_count": {
            "minimum": 0.0,
            "title": "Connection Count",
            "type": "integer"
          },
          "connections": {
            "items": {
              "$ref": "#/components/schemas/UserOffboardingConnectionResult"
            },
            "title": "Connections",
            "type": "array"
          },
          "idempotent_replay": {
            "default": false,
            "title": "Idempotent Replay",
            "type": "boolean"
          },
          "state": {
            "description": "Aggregate lifecycle state: accepted means revocation/cleanup was queued, partial_failure means at least one connection action failed and may be retried with the same key, and completed means all asynchronous cleanup actions have finished.",
            "enum": [
              "accepted",
              "partial_failure",
              "completed"
            ],
            "title": "State",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "aggregate_operation_id",
          "user_id",
          "state",
          "connection_count"
        ],
        "title": "UserOffboardingResult",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    },
    "securitySchemes": {
      "FinaticSession": {
        "description": "Device-bound Finatic session established with the calling company's credentials.",
        "in": "header",
        "name": "x-session-id",
        "type": "apiKey"
      },
      "HTTPBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "FinaticAPI REST API",
    "title": "Finatic FastAPI Backend",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/account-grants": {
      "get": {
        "description": "List account grants for the current company account.",
        "operationId": "finaticV1GetAccountGrants",
        "parameters": [
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_FDXAccountGrant__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Account Grants",
        "tags": [
          "account-grants"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-grants",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/account-grants/{grantId}": {
      "get": {
        "description": "Get one account grant for the current company account.",
        "operationId": "finaticV1GetAccountGrantsGrantId",
        "parameters": [
          {
            "in": "path",
            "name": "grantId",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXAccountGrant_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Account Grant",
        "tags": [
          "account-grants"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-grants",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      },
      "patch": {
        "description": "Update mutable account grant fields.",
        "operationId": "finaticV1PatchAccountGrantsGrantId",
        "parameters": [
          {
            "in": "path",
            "name": "grantId",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FDXAccountGrantUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXAccountGrant_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Update Account Grant",
        "tags": [
          "account-grants"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-grants",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/account-grants/{grantId}/revoke": {
      "post": {
        "description": "Revoke one account grant for the current company account.",
        "operationId": "finaticV1PostAccountGrantsGrantIdRevoke",
        "parameters": [
          {
            "in": "path",
            "name": "grantId",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXAccountGrant_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Revoke Account Grant",
        "tags": [
          "account-grants"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-grants",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts": {
      "get": {
        "description": "List broker accounts visible through active account grants.",
        "operationId": "finaticV1GetAccounts",
        "parameters": [
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Accounts",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}": {
      "get": {
        "description": "Get one broker account visible through an active account grant.",
        "operationId": "finaticV1GetAccountsAccountId",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__Any__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Account",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/balances": {
      "get": {
        "description": "List account-scoped balances.",
        "operationId": "finaticV1GetAccountsAccountIdBalances",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Account Balances",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/order-schemas": {
      "get": {
        "description": "Return JSON Schema for broker-specific order fields for this account.",
        "operationId": "finaticV1GetAccountsAccountIdOrderSchemas",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "description": "Order command action: place, modify, or cancel.",
            "in": "query",
            "name": "action",
            "required": true,
            "schema": {
              "description": "Order command action: place, modify, or cancel.",
              "title": "Action",
              "type": "string"
            }
          },
          {
            "description": "Optional broker id hint; must match account grant if set.",
            "in": "query",
            "name": "broker",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional broker id hint; must match account grant if set.",
              "title": "Broker"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__Any__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Account Order Schema",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/orders": {
      "get": {
        "description": "List account-scoped orders.",
        "operationId": "finaticV1GetAccountsAccountIdOrders",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Account Orders",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      },
      "post": {
        "description": "Create an account-scoped order with grant and idempotency checks.",
        "operationId": "finaticV1PostAccountsAccountIdOrders",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "title": "Idempotency-Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXBrokerOrderCommandResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Create Account Order",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/orders/{orderId}": {
      "delete": {
        "description": "Cancel an account-scoped order.",
        "operationId": "finaticV1DeleteAccountsAccountIdOrdersOrderId",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "title": "Order Id",
              "type": "string"
            }
          },
          {
            "description": "Optional broker id hint; must match account grant if set.",
            "in": "query",
            "name": "broker",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional broker id hint; must match account grant if set.",
              "title": "Broker"
            }
          },
          {
            "description": "Explicit per-operation confirmation for a Public sandbox order cancellation.",
            "in": "query",
            "name": "paperTradeConfirmed",
            "required": false,
            "schema": {
              "default": false,
              "description": "Explicit per-operation confirmation for a Public sandbox order cancellation.",
              "title": "Papertradeconfirmed",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "title": "Idempotency-Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXBrokerOrderCommandResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Cancel Account Order",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      },
      "get": {
        "description": "Get one order after account-grant authorization.",
        "operationId": "finaticV1GetAccountsAccountIdOrdersOrderId",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "title": "Order Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__Any__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Account Order",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      },
      "patch": {
        "description": "Modify an account-scoped order.",
        "operationId": "finaticV1PatchAccountsAccountIdOrdersOrderId",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "title": "Order Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "title": "Idempotency-Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountOrderCommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXBrokerOrderCommandResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Modify Account Order",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/orders/{orderId}/events": {
      "get": {
        "description": "List events for an account order.",
        "operationId": "finaticV1GetAccountsAccountIdOrdersOrderIdEvents",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "title": "Order Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Account Order Events",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/orders/{orderId}/fills": {
      "get": {
        "description": "List fills for an account order.",
        "operationId": "finaticV1GetAccountsAccountIdOrdersOrderIdFills",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "orderId",
            "required": true,
            "schema": {
              "title": "Order Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Account Order Fills",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/positions": {
      "get": {
        "description": "List account-scoped positions.",
        "operationId": "finaticV1GetAccountsAccountIdPositions",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Account Positions",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/transactions": {
      "get": {
        "description": "List account-scoped transactions.",
        "operationId": "finaticV1GetAccountsAccountIdTransactions",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Account Transactions",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/accounts/{accountId}/{resource}": {
      "get": {
        "description": "List account-scoped balances, positions, transactions, or orders.",
        "operationId": "finaticV1GetAccountsAccountIdResource",
        "parameters": [
          {
            "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
            "in": "path",
            "name": "accountId",
            "required": true,
            "schema": {
              "description": "Financial account ID returned by GET /api/v1/accounts; do not use companyAccountId.",
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "resource",
            "required": true,
            "schema": {
              "title": "Resource",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Account Resource",
        "tags": [
          "accounts"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "fdx-account-first",
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/owner-portal/account-grants/{grant_id}": {
      "patch": {
        "description": "Update resource clusters / trade on an account grant the user owns.",
        "operationId": "update_owner_account_grant_api_v1_owner_portal_account_grants__grant_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OwnerPortalAccountGrantUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXAccountGrant_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Owner Account Grant",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/account-grants/{grant_id}/revoke": {
      "post": {
        "description": "Revoke an account grant owned by the authenticated user.",
        "operationId": "revoke_owner_account_grant_api_v1_owner_portal_account_grants__grant_id__revoke_post",
        "parameters": [
          {
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Grant Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXAccountGrant_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Owner Account Grant",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/bootstrap": {
      "get": {
        "description": "Return all user connections and union company directory with per-connection grants.",
        "operationId": "get_owner_portal_bootstrap_api_v1_owner_portal_bootstrap_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_OwnerPortalBootstrapResponse_"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Owner Portal Bootstrap",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/brokers/connect": {
      "post": {
        "description": "Connect or reauth a broker without granting company access (personal connection).",
        "operationId": "owner_portal_connect_broker_api_v1_owner_portal_brokers_connect_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrokerConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_Any_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Owner Portal Connect Broker",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}": {
      "delete": {
        "description": "Disconnect a user-owned broker connection (personal or after revoking company access).",
        "operationId": "owner_portal_delete_connection_api_v1_owner_portal_connections__connection_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_OwnerPortalRevokeAllCompaniesResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Owner Portal Delete Connection",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}/account-grants": {
      "get": {
        "description": "List FDX account grants for an owner-owned connection (manage UI).",
        "operationId": "list_owner_connection_account_grants_api_v1_owner_portal_connections__connection_id__account_grants_get",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_OwnerPortalAccountGrant__"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Owner Connection Account Grants",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}/companies": {
      "delete": {
        "description": "Revoke every account grant for a connection.",
        "operationId": "revoke_all_owner_connection_account_grants_api_v1_owner_portal_connections__connection_id__companies_delete",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_OwnerPortalRevokeAllCompaniesResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke All Owner Connection Account Grants",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}/companies/{company_id}": {
      "delete": {
        "description": "Remove one company's access to a connection.",
        "operationId": "revoke_owner_connection_account_grants_api_v1_owner_portal_connections__connection_id__companies__company_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "company_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Company Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__str__"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Owner Connection Account Grants",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}/companies/{company_id}/permissions": {
      "patch": {
        "description": "Create or update account grants for one company on a user-owned connection.",
        "operationId": "update_owner_connection_company_permissions_api_v1_owner_portal_connections__connection_id__companies__company_id__permissions_patch",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "company_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Company Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OwnerPortalCompanyPermissionsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__str__"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Owner Connection Company Permissions",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}/discovered-accounts": {
      "get": {
        "description": "List broker accounts for an owner-owned connection (no company session).",
        "operationId": "list_owner_connection_discovered_accounts_api_v1_owner_portal_connections__connection_id__discovered_accounts_get",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Owner Connection Discovered Accounts",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/connections/{connection_id}/reauth-notification-preference": {
      "get": {
        "description": "Read reauth email preference for a user-owned connection.",
        "operationId": "get_owner_reauth_notification_preference_api_v1_owner_portal_connections__connection_id__reauth_notification_preference_get",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_ReauthNotificationPreference_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Owner Reauth Notification Preference",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      },
      "patch": {
        "description": "Persist reauth email preference for a user-owned connection.",
        "operationId": "update_owner_reauth_notification_preference_api_v1_owner_portal_connections__connection_id__reauth_notification_preference_patch",
        "parameters": [
          {
            "in": "path",
            "name": "connection_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connection Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReauthNotificationPreferenceUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_ReauthNotificationPreference_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Owner Reauth Notification Preference",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/owner-portal/institutions": {
      "get": {
        "description": "Return institution catalog for owner-portal connect/reconnect flows.",
        "operationId": "list_owner_portal_institutions_api_v1_owner_portal_institutions_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_dict_str__Any___"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Owner Portal Institutions",
        "tags": [
          "owner-portal"
        ],
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/portal/reauth-notification-opt-out": {
      "post": {
        "description": "Apply an email opt-out token through the API service boundary.",
        "operationId": "finaticV1PostPortalReauthNotificationOptOut",
        "parameters": [
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReauthNotificationOptOutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_ReauthNotificationOptOutResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Apply Reauth Notification Opt Out",
        "tags": [
          "portal"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk",
          "web",
          "portal"
        ],
        "x-sdk-method-name": "applyReauthNotificationOptOut",
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/session/init": {
      "post": {
        "description": "Initialize a new session with company API key.",
        "operationId": "finaticV1PostSessionInit",
        "parameters": [
          {
            "description": "Company API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "description": "Company API key",
              "title": "X-Api-Key",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_TokenResponseData_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Init Session",
        "tags": [
          "session"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ],
        "x-sdk-auth": "optional",
        "x-sdk-init-step": 1,
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/session/portal": {
      "get": {
        "description": "Get a portal URL with token for a session.\n\nThe session must be in ACTIVE or AUTHENTICATING state and the request must come from the same device\nthat initiated the session. Device info is automatically validated from the request.",
        "operationId": "finaticV1GetSessionPortal",
        "parameters": [
          {
            "description": "Session ID",
            "in": "header",
            "name": "session-id",
            "required": true,
            "schema": {
              "description": "Session ID",
              "title": "Session-Id",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_PortalUrlResponse_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Portal Url",
        "tags": [
          "session"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ],
        "x-sdk-auth": "required",
        "x-sdk-session-headers": true,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/session/start": {
      "post": {
        "description": "Start a session with a one-time token.",
        "operationId": "finaticV1PostSessionStart",
        "parameters": [
          {
            "description": "One-time use token obtained from init_session endpoint to authenticate and start the session",
            "in": "header",
            "name": "One-Time-Token",
            "required": true,
            "schema": {
              "description": "One-time use token obtained from init_session endpoint to authenticate and start the session",
              "title": "One-Time-Token",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SessionStartRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Optional JSON body. When omitted, the session starts without linking a user_id. Some clients send only the One-Time-Token header; they must not receive 422.",
                "title": "Start Request"
              }
            }
          },
          "description": "Session start request containing optional user ID to associate with the session"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_SessionResponseData_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Start Session",
        "tags": [
          "session"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ],
        "x-sdk-auth": "optional",
        "x-sdk-init-step": 1,
        "x-sdk-session-headers": false,
        "x-sdk-session-in-params": false
      }
    },
    "/api/v1/session/{sessionId}/user": {
      "get": {
        "description": "Get user information for a completed session.\n\nThis endpoint is designed for server SDKs to retrieve user information\nafter successful OTP verification.\n\n\nSecurity:\n- Requires valid session in ACTIVE state\n- Validates device fingerprint binding\n- Only accessible to authenticated sessions with user_id\n- Validates that header session_id matches path session_id",
        "operationId": "finaticV1GetSessionSessionIdUser",
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "description": "Session ID",
              "examples": [
                "sess_1234567890abcdef"
              ],
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "description": "Session ID from header (must match path parameter)",
            "in": "header",
            "name": "x-session-id",
            "required": true,
            "schema": {
              "description": "Session ID from header (must match path parameter)",
              "title": "X-Session-Id",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_SessionUserResponse_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Session User",
        "tags": [
          "session"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ],
        "x-sdk-auth": "required",
        "x-sdk-session-headers": true,
        "x-sdk-session-in-params": true
      }
    },
    "/api/v1/sessions": {
      "post": {
        "description": "Create an account-first v1 session from a company API key.",
        "operationId": "finaticV1PostSessions",
        "parameters": [
          {
            "description": "Company API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "description": "Company API key",
              "title": "X-Api-Key",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CreateSessionRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_SessionResponseData_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Create Session",
        "tags": [
          "sessions"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk",
          "web"
        ]
      }
    },
    "/api/v1/sessions/{sessionId}": {
      "get": {
        "description": "Get a v1 session by id.",
        "operationId": "finaticV1GetSessionsSessionId",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "description": "Company API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "description": "Company API key",
              "title": "X-Api-Key",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_SessionResponseData_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Session",
        "tags": [
          "sessions"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk",
          "web"
        ]
      }
    },
    "/api/v1/sessions/{sessionId}/portal-links": {
      "post": {
        "description": "Create a one-time portal link token for a v1 session.",
        "operationId": "finaticV1PostSessionsSessionIdPortalLinks",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "description": "Company API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "description": "Company API key",
              "title": "X-Api-Key",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_TokenResponseData_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Create Portal Link",
        "tags": [
          "sessions"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk",
          "web"
        ]
      }
    },
    "/api/v1/sessions/{sessionId}/sync-status": {
      "get": {
        "description": "Poll selected-account sync readiness for a v1 session.",
        "operationId": "finaticV1GetSessionsSessionIdSyncStatus",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "description": "Company API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "description": "Company API key",
              "title": "X-Api-Key",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_SessionSyncStatusResponse_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Session Sync Status",
        "tags": [
          "sessions"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk",
          "web"
        ]
      }
    },
    "/api/v1/sessions/{sessionId}/user": {
      "get": {
        "description": "Compatibility user polling route for plural sessions.",
        "operationId": "finaticV1GetSessionsSessionIdUser",
        "parameters": [
          {
            "in": "path",
            "name": "sessionId",
            "required": true,
            "schema": {
              "title": "Session Id",
              "type": "string"
            }
          },
          {
            "description": "Company API key",
            "in": "header",
            "name": "x-api-key",
            "required": true,
            "schema": {
              "description": "Company API key",
              "title": "X-Api-Key",
              "type": "string"
            }
          },
          {
            "description": "Select the Finatic environment for account-first v1 calls. Defaults to the API-key environment when omitted.",
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FinaticEnvironment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__Union_str__NoneType___"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Session User",
        "tags": [
          "sessions"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk",
          "web"
        ]
      }
    },
    "/api/v1/users/{userId}/offboarding": {
      "post": {
        "description": "Revoke caller access user-wide and queue orphaned connections.\n\nRequires a device-bound Finatic session established by the calling\ncompany. The Finatic/Supabase identity and historical records are always\npreserved. A sibling company anywhere in the user's active grant union\nprevents all connection cleanup; only the caller's grants are then\nrevoked.\n\nThe Idempotency-Key is scoped to the caller and environment. A same-key\nretry for this user replays the original result, while reusing the key for\nanother user returns an IDEMPOTENCY_KEY_REUSED conflict.",
        "operationId": "finaticV1PostUsersUserIdOffboarding",
        "parameters": [
          {
            "description": "Stable Finatic end-user UUID",
            "in": "path",
            "name": "userId",
            "required": true,
            "schema": {
              "description": "Stable Finatic end-user UUID",
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "description": "Client-generated retry key scoped to the calling company and Finatic environment. Repeating the key for the same user replays the original aggregate result; using it for another user returns an IDEMPOTENCY_KEY_REUSED conflict.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "description": "Client-generated retry key scoped to the calling company and Finatic environment. Repeating the key for the same user replays the original aggregate result; using it for another user returns an IDEMPOTENCY_KEY_REUSED conflict.",
              "title": "Idempotency-Key",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_UserOffboardingResult_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "security": [
          {
            "FinaticSession": []
          }
        ],
        "summary": "Offboard User",
        "tags": [
          "user-lifecycle"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ],
        "x-sdk-auth": "required",
        "x-sdk-session-headers": true
      }
    },
    "/api/v1/webhooks/catalog": {
      "get": {
        "description": "List supported outbound webhook event types.",
        "operationId": "finaticV1GetWebhooksCatalog",
        "parameters": [
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_FDXWebhookEventDefinition__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Webhook Catalog",
        "tags": [
          "webhooks"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "webhooks",
        "x-finatic-realtime-payload-shape": "webhook-event-v1",
        "x-finatic-realtime-scope": [
          "session",
          "accessible_accounts"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/webhooks/payload-schema": {
      "get": {
        "description": "Return the documented outbound webhook payload JSON schema.",
        "operationId": "finaticV1GetWebhooksPayloadSchema",
        "parameters": [
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_dict_str__object__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Get Webhook Payload Schema",
        "tags": [
          "webhooks"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "webhooks",
        "x-finatic-realtime-payload-shape": "webhook-event-v1",
        "x-finatic-realtime-scope": [
          "session",
          "accessible_accounts"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/webhooks/subscriptions": {
      "get": {
        "description": "List webhook subscriptions for the current company account.",
        "operationId": "finaticV1GetWebhooksSubscriptions",
        "parameters": [
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_list_FDXWebhookSubscription__"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "List Webhook Subscriptions",
        "tags": [
          "webhooks"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "webhooks",
        "x-finatic-realtime-payload-shape": "webhook-event-v1",
        "x-finatic-realtime-scope": [
          "session",
          "accessible_accounts"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      },
      "post": {
        "description": "Create a webhook subscription for the current company account.",
        "operationId": "finaticV1PostWebhooksSubscriptions",
        "parameters": [
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FDXWebhookSubscriptionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXWebhookSubscription_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Create Webhook Subscription",
        "tags": [
          "webhooks"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "webhooks",
        "x-finatic-realtime-payload-shape": "webhook-event-v1",
        "x-finatic-realtime-scope": [
          "session",
          "accessible_accounts"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/webhooks/subscriptions/{subscriptionId}": {
      "patch": {
        "description": "Update a webhook subscription for the current company account.",
        "operationId": "finaticV1PatchWebhooksSubscriptionsSubscriptionId",
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Subscription Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FDXWebhookSubscriptionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXWebhookSubscription_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Update Webhook Subscription",
        "tags": [
          "webhooks"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "webhooks",
        "x-finatic-realtime-payload-shape": "webhook-event-v1",
        "x-finatic-realtime-scope": [
          "session",
          "accessible_accounts"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    },
    "/api/v1/webhooks/subscriptions/{subscriptionId}/revoke": {
      "post": {
        "description": "Revoke a webhook subscription for the current company account.",
        "operationId": "finaticV1PostWebhooksSubscriptionsSubscriptionIdRevoke",
        "parameters": [
          {
            "in": "path",
            "name": "subscriptionId",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Subscription Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Finatic-Environment",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Finatic-Environment"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticResponse_FDXWebhookSubscription_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Bad Request - Domain error (e.g., BROKER_MISMATCH, CONNECTION_EXISTS, INVALID_CONNECTION_STATUS). See error.code for specific domain code."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Unauthorized - Authentication error (e.g., AUTH_ERROR, INVALID_API_KEY, INVALID_TOKEN, SESSION_NOT_FOUND). See error.code for specific auth code."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Forbidden - Access denied (e.g., ACCESS_DENIED, TRADE_ACCESS_DENIED, READ_ACCESS_DENIED). See error.code for specific access code."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Not Found - Resource not found (e.g., ORDER_NOT_FOUND, ACCOUNT_NOT_FOUND, CONNECTION_NOT_FOUND). See error.code for specific resource code."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Conflict - Resource conflict (e.g., CONNECTION_EXISTS). See error.code for specific conflict code."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Validation Error - Request validation failed (e.g., VALIDATION_ERROR, MISSING_REQUIRED, MISSING_PERMISSIONS). See error.code for specific validation code."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Rate Limit Exceeded - Too many requests (RATE_LIMIT_EXCEEDED). See error.code for specific rate limit code."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Internal Server Error - Server error (e.g., INTERNAL_ERROR, ORDER_PLACEMENT_ERROR, MISSING_CONNECTION_ID). See error.code for specific internal error code."
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinaticAPIErrorResponse"
                }
              }
            },
            "description": "Broker Error - Broker API error (BROKER_ERROR). See error.code and error.details for broker-specific error information."
          }
        },
        "summary": "Revoke Webhook Subscription",
        "tags": [
          "webhooks"
        ],
        "x-finatic-environment-header": "X-Finatic-Environment",
        "x-finatic-environments": [
          "live",
          "sandbox"
        ],
        "x-finatic-error-taxonomy": [
          "AUTHENTICATION",
          "AUTHORIZATION",
          "VALIDATION",
          "RATE_LIMITED",
          "REAUTH_REQUIRED",
          "PROVIDER_ERROR",
          "CONFLICT",
          "NOT_FOUND",
          "INTERNAL"
        ],
        "x-finatic-extension": "webhooks",
        "x-finatic-realtime-payload-shape": "webhook-event-v1",
        "x-finatic-realtime-scope": [
          "session",
          "accessible_accounts"
        ],
        "x-finatic-response-envelope": "FinaticV1ResponseEnvelope",
        "x-mcp-export": true,
        "x-sdk-audiences": [
          "sdk"
        ]
      }
    }
  },
  "tags": [
    {
      "description": "Methods for managing sessions and authentication.",
      "name": "session",
      "x-sdk-api-name": "SessionApi",
      "x-sdk-api-path": "session",
      "x-sdk-doc-description": "Methods for managing sessions and authentication.",
      "x-sdk-doc-title": "Session Management"
    }
  ],
  "x-finatic-provenance": {
    "artifact": "finaticapi-public-web-openapi",
    "artifactVersion": "1",
    "sourceCommit": "48cf4d2f51662bb1a01f202d7a4486e692e7773b",
    "sourceRepository": "FinaticORG/FinaticAPI"
  }
}
