{"openapi":"3.0.0","paths":{"/":{"get":{"operationId":"AppController_getHello","parameters":[],"responses":{"200":{"description":""}},"tags":["App"]}},"/suppliers":{"post":{"operationId":"SupplierController_create","parameters":[],"requestBody":{"required":true,"description":"Data for the new supplier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierCreateRequest"}}}},"responses":{"201":{"description":"Successfully created the supplier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierResponse"}}}},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Create a new supplier","tags":["Suppliers"]},"get":{"operationId":"SupplierController_findAll","parameters":[{"name":"q","required":false,"in":"query","description":"Search query to filter suppliers by name or other fields","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of suppliers to return (default: 10)","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor for fetching the next page","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved list of suppliers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierListResponse"}}}},"400":{"description":"Bad Request: Invalid query parameters."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"List suppliers with optional search and pagination","tags":["Suppliers"]}},"/suppliers/duplicates/report":{"get":{"description":"Flags suppliers with duplicate normalized names, provider/name identities, or external references within the tenant and inferred company scope.","operationId":"SupplierController_getDuplicateReport","parameters":[],"responses":{"200":{"description":"Successfully generated supplier duplicate report.","content":{"application/json":{"schema":{"type":"object","properties":{"totalGroups":{"type":"number"},"groups":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","enum":["NORMALIZED_NAME","PROVIDER_NORMALIZED_NAME","EXTERNAL_REFERENCE"]},"key":{"type":"string"},"tenantId":{"type":"string"},"companyScope":{"type":"string"},"provider":{"type":"string","nullable":true},"externalSupplierId":{"type":"string","nullable":true},"normalizedName":{"type":"string","nullable":true},"suppliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalizedName":{"type":"string"},"provider":{"type":"string","nullable":true},"externalSupplierId":{"type":"string","nullable":true},"companyScope":{"type":"string"}}}}}}}}}}}}},"security":[{"bearer":[]}],"summary":"Report possible duplicate suppliers","tags":["Suppliers"]}},"/suppliers/duplicates/pre-wipe-validation":{"get":{"description":"Samples duplicate Aequo suppliers and checks whether the duplicates point to a single source-system supplier identity before a wipe/reimport is attempted.","operationId":"SupplierController_getPreWipeValidation","parameters":[{"name":"sampleSize","required":false,"in":"query","description":"Number of duplicate groups to sample, capped at 100.","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully generated supplier pre-wipe validation report."}},"security":[{"bearer":[]}],"summary":"Validate supplier duplicates before a wipe/reimport","tags":["Suppliers"]}},"/suppliers/{id}":{"get":{"operationId":"SupplierController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the supplier","schema":{"format":"string","type":"string"}},{"name":"includeTolerance","required":false,"in":"query","description":"Include tolerance data in the response (default: true for backward compatibility)","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successfully retrieved supplier details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Supplier with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get a specific supplier by its ID","tags":["Suppliers"]},"patch":{"operationId":"SupplierController_update","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the supplier to update","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"description":"Data to update the supplier with","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierUpdateRequest"}}}},"responses":{"200":{"description":"Successfully updated the supplier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierResponse"}}}},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Supplier with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Update an existing supplier","tags":["Suppliers"]},"delete":{"operationId":"SupplierController_remove","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the supplier to delete","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Successfully deleted the supplier."},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Supplier with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Delete a supplier by its ID","tags":["Suppliers"]}},"/suppliers/{id}/email-test":{"post":{"operationId":"SupplierController_testEmail","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the supplier","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successfully sent test email.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierEmailTestResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format or supplier has no email configured."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Supplier with the specified ID does not exist."},"500":{"description":"Internal server error (e.g., email sending failed)."}},"security":[{"bearer":[]}],"summary":"Send a test email to the supplier's configured contact","tags":["Suppliers"]}},"/suppliers/{id}/coding-history":{"get":{"description":"Returns historical GL coding patterns based on processed invoices from this supplier. Used by AI agents for GL code suggestions.","operationId":"SupplierController_getGlCodingHistory","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the supplier","schema":{"format":"uuid","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of invoices to analyze (default: 50)","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully retrieved GL coding history.","content":{"application/json":{"schema":{"type":"object","properties":{"supplierId":{"type":"string"},"supplierName":{"type":"string"},"codingPatterns":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"glCode":{"type":"string"},"frequency":{"type":"number"},"lastUsed":{"type":"string","format":"date-time"},"averageAmount":{"type":"number"}}}},"recentInvoices":{"type":"array","items":{"type":"object","properties":{"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string","format":"date-time"},"lineItems":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"glCode":{"type":"string","nullable":true},"amount":{"type":"number"}}}}}}}}}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Supplier with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get GL coding history for a supplier","tags":["Suppliers"]}},"/csv-mappings/{supplierId}":{"get":{"operationId":"CsvMappingController_findOne","parameters":[{"name":"supplierId","required":true,"in":"path","description":"UUID of the supplier","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierCsvMappingResponse"}}}}},"security":[{"bearer":[]}],"summary":"Fetch the saved CSV mapping for a supplier","tags":["CSV Mappings"]},"put":{"operationId":"CsvMappingController_upsert","parameters":[{"name":"supplierId","required":true,"in":"path","description":"UUID of the supplier","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertSupplierCsvMappingRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierCsvMappingResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create or update the saved CSV mapping for a supplier","tags":["CSV Mappings"]}},"/documents":{"post":{"operationId":"DocumentController_uploadDocument","parameters":[],"requestBody":{"required":true,"description":"Document file and metadata. Send as multipart/form-data.","content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The document file (e.g., PDF, PNG, JPG)"},"supplierId":{"type":"string","format":"uuid","description":"UUID of the associated supplier"},"type":{"enum":["PO","INV","DN"],"description":"Type of the document"}},"required":["file","supplierId","type"]}}}},"responses":{"202":{"description":"Document accepted for processing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentReprocessResponse"}}}},"400":{"description":"Bad Request: Invalid input data or missing file."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Upload a new document for processing","tags":["Documents"]},"get":{"operationId":"DocumentController_findDocuments","parameters":[{"name":"include","required":false,"in":"query","description":"Comma-separated list of additional fields to include (e.g., \"insuranceIds\")","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","description":"Filter by document type","schema":{"enum":["PO","INV","DN"],"type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by document status","schema":{"enum":["PROCESSING","READY","FAILED","ARCHIVED","REVIEW_REQUIRED","DUPLICATE"],"type":"string"}},{"name":"needs_review","required":false,"in":"query","description":"Filter by whether document needs review","schema":{"type":"boolean"}},{"name":"from","required":false,"in":"query","description":"Filter documents created from this ISO8601 date (inclusive)","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","description":"Filter documents created up to this ISO8601 date (inclusive)","schema":{"format":"date-time","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of documents to return","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor for fetching the next page","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","description":"Field used to sort documents","schema":{"enum":["createdAt","supplierName"],"type":"string"}},{"name":"sortDirection","required":false,"in":"query","description":"Sort direction for the selected sort field","schema":{"enum":["asc","desc"],"type":"string"}},{"name":"supplierId","required":false,"in":"query","description":"Filter by supplier ID","schema":{"type":"string"}},{"name":"supplierName","required":false,"in":"query","description":"Filter by supplier name text","schema":{"type":"string"}},{"name":"matchId","required":false,"in":"query","description":"Filter documents linked to a specific match","schema":{"type":"string"}},{"name":"needsPoLink","required":true,"in":"query","schema":{"type":"boolean"}},{"name":"branchId","required":false,"in":"query","description":"Filter documents tagged to a branch (location)","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved list of documents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"400":{"description":"Bad Request: Invalid filter parameters."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"List documents with optional filters and pagination","tags":["Documents"]}},"/documents/stats":{"get":{"operationId":"DocumentController_getDocumentStats","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Tenant-wide document counts (e.g. invoices missing a PO link). Used for actionable guidance on the documents page.","tags":["Documents"]}},"/documents/artifacts":{"get":{"operationId":"DocumentController_findDocumentArtifacts","parameters":[{"name":"type","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierName","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":true,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"number"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}},{"name":"branchId","required":false,"in":"query","description":"Filter to documents tagged to a branch (location); Aequo purchase orders are left out","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List operational artifacts for the Documents page type filters. PO includes both uploaded PO documents and Aequo purchase orders.","tags":["Documents"]}},"/documents/purchase-order-artifacts":{"get":{"operationId":"DocumentController_findPurchaseOrderArtifacts","parameters":[{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierName","required":true,"in":"query","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":true,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"number"}},{"name":"cursor","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Deprecated alias for the PO artifacts list. Use /documents/artifacts?type=PO.","tags":["Documents"]}},"/documents/{doc_id}/po-suggestions":{"get":{"operationId":"DocumentController_suggestPurchaseOrders","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"AI suggestions of likely matching purchase orders for an invoice. Ranks open POs for the same supplier by amount + date proximity so an operator can link a missing PO with one click.","tags":["Documents"]}},"/documents/approval-queue":{"get":{"operationId":"DocumentController_getApprovalQueue","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalQueueResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List invoices awaiting the current user approval","tags":["Documents"]}},"/documents/{doc_id}":{"get":{"operationId":"DocumentController_getDocumentById","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document","schema":{"format":"uuid","type":"string"}},{"name":"include","required":false,"in":"query","description":"Comma-separated list of additional fields to include (e.g., \"insuranceIds\")","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved document details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Document with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get a specific document by its ID","tags":["Documents"]},"patch":{"operationId":"DocumentController_updateDocument","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update document metadata and review state","tags":["Documents"]},"delete":{"operationId":"DocumentController_deleteDocument","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document to delete","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Successfully deleted the document."},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Document with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Delete a specific document by its ID","tags":["Documents"]}},"/documents/{doc_id}/coding":{"put":{"operationId":"DocumentController_updateDocumentCoding","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentCodingRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}}},"security":[{"bearer":[]}],"summary":"Save line-level GL coding for an invoice document","tags":["Documents"]}},"/documents/{doc_id}/lines/{line_id}/coding":{"patch":{"operationId":"DocumentController_updateDocumentLineCoding","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}},{"name":"line_id","required":true,"in":"path","description":"Line item ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchDocumentLineCodingRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update GL coding for a single invoice line item","tags":["Documents"]}},"/documents/{doc_id}/lines/{line_id}/splits":{"post":{"operationId":"DocumentController_upsertDocumentLineSplits","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}},{"name":"line_id","required":true,"in":"path","description":"Line item ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertDocumentLineSplitsRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create or replace split allocations for a single invoice line item","tags":["Documents"]}},"/documents/{doc_id}/lines/{line_id}/splits/{split_id}":{"delete":{"operationId":"DocumentController_deleteDocumentLineSplit","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}},{"name":"line_id","required":true,"in":"path","description":"Line item ID","schema":{"type":"string"}},{"name":"split_id","required":true,"in":"path","description":"Split allocation ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}}},"security":[{"bearer":[]}],"summary":"Delete a split allocation from a single invoice line item","tags":["Documents"]}},"/documents/{doc_id}/coding/suggest":{"post":{"operationId":"DocumentController_suggestDocumentCoding","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}}},"security":[{"bearer":[]}],"summary":"Re-run AI coding suggestions for an invoice document","tags":["Documents"]}},"/documents/{doc_id}/approval":{"get":{"operationId":"DocumentController_getDocumentApproval","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get the latest approval chain for an invoice document","tags":["Documents"]}},"/documents/{doc_id}/approval/routing":{"get":{"operationId":"DocumentController_getDocumentApprovalRouting","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalRoutingResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Preview approval routing for an invoice. When no approval rule matches, includes the Approval Concierge suggested approver and assignable users.","tags":["Documents"]}},"/documents/{doc_id}/approval/submit":{"post":{"operationId":"DocumentController_submitDocumentApproval","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentApprovalRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalRequestDto"}}}}},"security":[{"bearer":[]}],"summary":"Submit an invoice for approval routing","tags":["Documents"]}},"/documents/{doc_id}/approval/decision":{"post":{"operationId":"DocumentController_decideDocumentApproval","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalDecisionRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalRequestDto"}}}}},"security":[{"bearer":[]}],"summary":"Approve or reject the current invoice approval step","tags":["Documents"]}},"/documents/{doc_id}/accounting-writeback":{"get":{"operationId":"DocumentController_getDocumentWritebackStatus","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentWritebackStatusDto"}}}}},"security":[{"bearer":[]}],"summary":"Get accounting writeback status for an invoice","tags":["Documents"]}},"/documents/{doc_id}/accounting-writeback/retry":{"post":{"operationId":"DocumentController_retryDocumentWriteback","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentWritebackStatusDto"}}}}},"security":[{"bearer":[]}],"summary":"Retry a failed accounting writeback","tags":["Documents"]}},"/documents/{doc_id}/payment":{"get":{"operationId":"DocumentController_getDocumentPayment","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPaymentEnvelopeDto"}}}}},"security":[{"bearer":[]}],"summary":"Get the current payment request for an invoice","tags":["Documents"]},"post":{"operationId":"DocumentController_scheduleDocumentPayment","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDocumentPaymentRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPaymentResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Schedule payment handoff for an approved invoice","tags":["Documents"]}},"/documents/{doc_id}/download":{"get":{"operationId":"DocumentController_getDocumentDownloadUrl","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successfully retrieved download URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDownloadUrlResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Document with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get a temporary download URL for a document's file","tags":["Documents"]}},"/documents/{doc_id}/preview":{"get":{"operationId":"DocumentController_getDocumentPreview","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successfully resolved preview metadata and signed URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPreviewResponse"}}}},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Document with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Resolve a temporary preview URL for a document's file","tags":["Documents"]}},"/documents/{doc_id}/reprocess":{"post":{"operationId":"DocumentController_reprocessDocument","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document to reprocess","schema":{"format":"string","type":"string"}}],"responses":{"202":{"description":"Document reprocessing initiated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentReprocessResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Document with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Trigger reprocessing for a specific document","tags":["Documents"]}},"/documents/{doc_id}/insurance-metadata":{"post":{"operationId":"DocumentController_createInsuranceMetadata","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"description":"Insurance metadata","content":{"application/json":{"schema":{"type":"object","properties":{"claimId":{"type":"string","description":"Insurance claim ID"},"policyId":{"type":"string","description":"Insurance policy ID"},"treatyId":{"type":"string","description":"Insurance treaty ID"},"lob":{"type":"string","description":"Insurance line of business"}}}}}},"responses":{"201":{"description":"Insurance metadata created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInsuranceMetadataResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create or update insurance metadata for a document","tags":["Documents"]},"patch":{"operationId":"DocumentController_updateDocumentInsuranceMetadata","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsuranceMetadataRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInsuranceMetadataResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update insurance metadata for a document","tags":["Documents"]},"delete":{"operationId":"DocumentController_deleteInsuranceMetadata","parameters":[{"name":"doc_id","required":true,"in":"path","description":"UUID of the document","schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Insurance metadata deleted successfully."}},"security":[{"bearer":[]}],"summary":"Delete insurance metadata for a document","tags":["Documents"]}},"/documents/{doc_id}/insurance-metadata/validate":{"post":{"operationId":"DocumentController_validateDocumentInsuranceMetadata","parameters":[{"name":"doc_id","required":true,"in":"path","description":"Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsuranceMetadataRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsuranceMetadataValidationResponse"}}}}},"security":[{"bearer":[]}],"summary":"Validate insurance metadata for a document without saving it","tags":["Documents"]}},"/approval-requests/my-pending":{"get":{"operationId":"ApprovalRequestController_getMyPendingApprovalRequests","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentApprovalQueueResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List pending approval requests assigned to the signed-in approver","tags":["Approval Requests"]}},"/invoices/{id}/semantic_matches":{"get":{"operationId":"InvoiceController_getSemanticMatches","parameters":[{"name":"id","required":true,"in":"path","description":"Invoice Document ID","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSemanticMatchesResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Get top semantic match candidates for an invoice","tags":["Invoices"]}},"/invoices/{id}/semantic_match":{"patch":{"operationId":"InvoiceController_patchSemanticMatch","parameters":[{"name":"id","required":true,"in":"path","description":"Invoice Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchSemanticMatchRequestDTO"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchSemanticMatchResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Submit human decision for invoice semantic match","tags":["Invoices"]}},"/invoices/{id}":{"patch":{"operationId":"InvoiceController_patchInvoiceIdentifiers","parameters":[{"name":"id","required":true,"in":"path","description":"Invoice Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsuranceMetadataRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentInsuranceMetadataResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update extracted identifiers for an invoice","tags":["Invoices"]}},"/invoices/{id}/validate-identifiers":{"post":{"operationId":"InvoiceController_validateInvoiceIdentifiers","parameters":[{"name":"id","required":true,"in":"path","description":"Invoice Document ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsuranceMetadataRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsuranceMetadataValidationResponse"}}}}},"security":[{"bearer":[]}],"summary":"Validate extracted identifiers for an invoice without saving","tags":["Invoices"]}},"/exceptions":{"get":{"operationId":"ExceptionController_getExceptions","parameters":[{"name":"status","required":false,"in":"query","description":"Filter by exception status","schema":{"enum":["EXCEPTION","OPEN","INVESTIGATING","AWAITING_VENDOR","PENDING_SUPPLIER","RESOLUTION_PROPOSED","ESCALATED","RESOLVED","CLOSED"],"type":"string"}},{"name":"matchId","required":false,"in":"query","description":"Filter by associated match ID","schema":{"format":"uuid","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of exceptions to return","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor for fetching the next page","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved list of exceptions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionListResponse"}}}},"400":{"description":"Bad Request: Invalid filter parameters."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"List exceptions with optional filters and pagination","tags":["Exceptions"]}},"/exceptions/{id}/investigate":{"post":{"operationId":"ExceptionController_investigateException","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception to investigate","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerExceptionInvestigationRequest"}}}},"responses":{"200":{"description":"Investigation completed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionInvestigationResponse"}}}}},"security":[{"bearer":[]}],"summary":"Run exception investigation and produce a resolution proposal","tags":["Exceptions"]}},"/exceptions/{id}/investigation":{"get":{"operationId":"ExceptionController_getInvestigation","parameters":[{"name":"id","required":true,"in":"path","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Latest investigation result, or null if none exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionInvestigationResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get the latest investigation result for exception","tags":["Exceptions"]}},"/exceptions/{id}/accept-resolution":{"post":{"operationId":"ExceptionController_acceptResolution","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResolutionDecisionRequest"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Accept suggested exception resolution and mark as resolved","tags":["Exceptions"]}},"/exceptions/{id}/reject-resolution":{"post":{"operationId":"ExceptionController_rejectResolution","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResolutionDecisionRequest"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Reject suggested exception resolution and return to open triage","tags":["Exceptions"]}},"/exceptions/{id}":{"get":{"operationId":"ExceptionController_getExceptionById","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception to retrieve","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the exception.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionDTO"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Exception with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get a specific exception by its ID","tags":["Exceptions"]},"patch":{"operationId":"ExceptionController_updateExceptionStatus","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception to update","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"description":"Data to update the exception with","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionUpdateRequest"}}}},"responses":{"200":{"description":"Successfully updated the exception.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionDTO"}}}},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Exception with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Update the status or details of an exception","tags":["Exceptions"]}},"/exceptions/{id}/history":{"get":{"operationId":"ExceptionController_getExceptionHistory","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Successfully retrieved exception history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionHistoryResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Exception with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get the history log for a specific exception","tags":["Exceptions"]}},"/exceptions/{id}/presence":{"get":{"operationId":"ExceptionController_getPresence","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Presence state returned successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionPresenceResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get active collaborators currently viewing this exception.","tags":["Exceptions"]},"post":{"operationId":"ExceptionController_postPresenceHeartbeat","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception","schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"description":"Presence heartbeat accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionPresenceResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Publish a collaboration heartbeat while viewing this exception.","tags":["Exceptions"]}},"/exceptions/{id}/email-supplier":{"post":{"operationId":"ExceptionController_emailSupplier","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":false,"description":"Optional custom email content (uses template if omitted)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSupplierRequest"}}}},"responses":{"200":{"description":"Successfully sent email to supplier.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSupplierResponse"}}}},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Exception or associated Supplier with the specified ID does not exist."},"500":{"description":"Internal server error (e.g., email sending failed)."}},"security":[{"bearer":[]}],"summary":"Send an email to the supplier regarding an exception","tags":["Exceptions"]}},"/exceptions/{id}/comments":{"post":{"operationId":"ExceptionController_addCommentToException","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"description":"Comment content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentPayload"}}}},"responses":{"201":{"description":"Successfully added the comment and returned the history event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionHistoryEventDTO"}}}},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Exception with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Add a comment to a specific exception","tags":["Exceptions"]}},"/exceptions/{id}/evidence":{"post":{"operationId":"ExceptionController_addEvidenceToException","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the exception","schema":{"format":"uuid","type":"string"}}],"requestBody":{"required":true,"description":"Evidence file and optional comment. The file should be sent as part of a FormData object with the key `evidenceFile`.","content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AddEvidencePayload"}}}},"responses":{"201":{"description":"Successfully uploaded evidence and returned the history event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionHistoryEventDTO"}}}},"400":{"description":"Bad Request: Invalid input, UUID format, or file issue."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Exception with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Upload evidence for a specific exception","tags":["Exceptions"]}},"/matches":{"get":{"operationId":"MatchController_getMatches","parameters":[{"name":"status","required":false,"in":"query","description":"Filter by match status","schema":{"enum":["CLEARED","CLEARED_MANUAL","EXCEPTION","PENDING_SUPPLIER","PENDING_QA"],"type":"string"}},{"name":"startDate","required":false,"in":"query","description":"Filter matches from this ISO8601 date (inclusive)","schema":{"format":"date-time","type":"string"}},{"name":"endDate","required":false,"in":"query","description":"Filter matches up to this ISO8601 date (inclusive)","schema":{"format":"date-time","type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of matches to return","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor for fetching the next page","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved list of matches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchListResponse"}}}},"400":{"description":"Bad Request: Invalid filter parameters."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"List matches with optional filters and pagination","tags":["Matches"]}},"/matches/{match_id}":{"get":{"operationId":"MatchController_getMatchById","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved match header details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchHeaderResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Match with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get the header details of a specific match","tags":["Matches"]}},"/matches/{match_id}/lines":{"get":{"operationId":"MatchController_getMatchLines","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","description":"Pagination cursor for fetching the next page of lines","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of lines to return","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully retrieved match lines.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchLineListResponse"}}}},"400":{"description":"Bad Request: Invalid UUID or query parameters."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Match with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get the line items for a specific match with pagination","tags":["Matches"]}},"/matches/backfill-finalisation-decisions":{"post":{"operationId":"MatchController_backfillFinalisationDecisions","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceNumber":{"type":"string","description":"Optional invoice/bill number filter, e.g. \"7468\". Uses contains matching."},"matchIds":{"type":"array","items":{"type":"string"},"description":"Optional explicit match IDs to evaluate."},"limit":{"type":"number","description":"Maximum exception matches to evaluate. Capped at 100."},"dryRun":{"type":"boolean","description":"When true, returns decisions without clearing matches or writing side effects."}}}}}},"responses":{"200":{"description":"Backfill evaluation completed."},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"403":{"description":"Forbidden: OWNER or ADMIN role required unless dryRun is true."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Re-run finalisation policy for existing exception matches and auto-clear only safe cases.","tags":["Matches"]}},"/matches/{match_id}/approve":{"post":{"operationId":"MatchController_approveMatch","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match to approve","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Approval details (e.g., reason code)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveMatchRequest"}}}},"responses":{"204":{"description":"Successfully approved the match."},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Match with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Approve a match, potentially resolving exceptions","tags":["Matches"]}},"/matches/{match_id}/dispute":{"post":{"operationId":"MatchController_disputeMatch","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match to dispute","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Dispute details (e.g., reason, comments)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeMatchRequest"}}}},"responses":{"204":{"description":"Successfully disputed the match."},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Match with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Dispute a match, creating or updating an exception","tags":["Matches"]}},"/matches/{match_id}/split-lines":{"post":{"operationId":"MatchController_splitMatchLines","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match containing lines to split","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Details of the lines to split and how","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitLinesRequest"}}}},"responses":{"204":{"description":"Successfully split the match lines."},"400":{"description":"Bad Request: Invalid input data, UUID format, or split logic."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Match or specified lines do not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Split match lines (e.g., for partial matching)","tags":["Matches"]}},"/matches/bulk-approve":{"post":{"description":"Attempts to approve each match ID provided. Returns counts of success and lists any errors.","operationId":"MatchController_bulkApproveMatches","parameters":[],"requestBody":{"required":true,"description":"List of match IDs to approve.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkActionRequest"}}}},"responses":{"200":{"description":"Bulk approval process completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveResponse"}}}},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Approve multiple matches in bulk","tags":["Matches"]}},"/matches/bulk-dispute":{"post":{"description":"Attempts to dispute each match ID provided. Returns counts of success and lists any errors.","operationId":"MatchController_bulkDisputeMatches","parameters":[],"requestBody":{"required":true,"description":"List of match IDs to dispute. Assumes a default or context-derived dispute reason.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkActionRequest"}}}},"responses":{"200":{"description":"Bulk dispute process completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDisputeResponse"}}}},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Dispute multiple matches in bulk","tags":["Matches"]}},"/matches/introspect":{"post":{"description":"Provides a detailed analysis of how the match engine would process the given documents, including line joining, variances, and tolerance checks. This is a dry-run and does not persist any match data.","operationId":"MatchController_introspectMatch","parameters":[],"requestBody":{"required":true,"description":"Document IDs and optional overrides for introspection.","content":{"application/json":{"schema":{"type":"object","properties":{"poDocumentId":{"type":"string","format":"string","description":"ID of the PO Document","nullable":true},"systemPoId":{"type":"string","format":"string","description":"ID of the system PurchaseOrder record","nullable":true},"invoiceDocumentId":{"type":"string","format":"string","description":"ID of the Invoice Document (required)"},"deliveryNoteDocumentId":{"type":"string","format":"string","description":"ID of the Delivery Note Document","nullable":true},"overrideConfig":{"type":"object","description":"Optional overrides for matching configuration","nullable":true},"overrideTolerances":{"type":"object","description":"Optional overrides for tolerances","nullable":true}},"required":["invoiceDocumentId"]}}}},"responses":{"200":{"description":"Successfully performed match introspection."},"400":{"description":"Bad Request: Invalid input data (e.g., missing required document IDs)."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: One or more specified documents do not exist or are not of the correct type."},"500":{"description":"Internal server error during introspection."}},"security":[{"bearer":[]}],"summary":"Introspect a potential match between documents without saving.","tags":["Matches"]}},"/matches/{match_id}/join-lines":{"post":{"operationId":"MatchController_joinLines","parameters":[{"name":"match_id","required":true,"in":"path","description":"The ID of the match","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Array of line IDs to join","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinLinesRequest"}}}},"responses":{"204":{"description":"Lines joined successfully."},"400":{"description":"Bad request (e.g., invalid line IDs, match not actionable)."},"404":{"description":"Match not found."}},"security":[{"bearer":[]}],"summary":"Join specified line items within a match","tags":["Matches"]}},"/matches/{match_id}/qa-verify":{"post":{"operationId":"MatchController_qaVerifyMatch","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match to QA verify","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully QA verified the match."},"400":{"description":"Match is not pending QA verification."},"404":{"description":"Match not found."}},"security":[{"bearer":[]}],"summary":"Verify a match that is pending QA review (Enterprise only)","tags":["Matches"]}},"/matches/{match_id}/coding":{"patch":{"description":"Sets job / cost code / Build PO on the match header and optional per-line cost-code overrides. Pass null to clear a field.","operationId":"MatchController_updateCoding","parameters":[{"name":"match_id","required":true,"in":"path","description":"UUID of the match","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMatchCodingDto"}}}},"responses":{"200":{"description":"Coding updated."},"404":{"description":"Match, referenced job/cost-code/PO, or line not found."}},"security":[{"bearer":[]}],"summary":"Update Build (construction) coding on a match","tags":["Matches"]}},"/matches/{match_id}/recommendations":{"get":{"operationId":"MatchController_getRecommendations","parameters":[{"name":"match_id","required":true,"in":"path","description":"The ID of the match","schema":{"type":"string"}},{"name":"forceRefresh","required":false,"in":"query","description":"Set to true to bypass cache and regenerate recommendations.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"AI recommendations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMatchRecommendationsResponse"}}}},"404":{"description":"Match not found."}},"security":[{"bearer":[]}],"summary":"Get AI-generated recommendations for a match","tags":["Matches"]}},"/settings/matching-config":{"get":{"operationId":"MatchingConfigController_getConfig","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchingConfigDto"}}}}},"security":[{"bearer":[]}],"summary":"Get matching rules configuration.","tags":["Matching Config"]},"put":{"operationId":"MatchingConfigController_updateConfig","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMatchingConfigDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMatchingConfigResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Update matching rules configuration and notify workers to hot-reload.","tags":["Matching Config"]}},"/settings/global-tolerance":{"get":{"operationId":"GlobalToleranceController_getConfig","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalToleranceDto"}}}}},"security":[{"bearer":[]}],"summary":"Get tenant global tolerance settings.","tags":["Global Tolerance"]},"patch":{"operationId":"GlobalToleranceController_updateConfig","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGlobalToleranceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalToleranceDto"}}}}},"security":[{"bearer":[]}],"summary":"Update or create tenant global tolerance settings.","tags":["Global Tolerance"]}},"/settings/global-tolerance/profiles":{"get":{"operationId":"GlobalToleranceController_getProfiles","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ToleranceProfileDto"}}}}}},"security":[{"bearer":[]}],"summary":"List all available industry tolerance profiles.","tags":["Global Tolerance"]}},"/settings/global-tolerance/profiles/apply":{"post":{"operationId":"GlobalToleranceController_applyProfile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyToleranceProfileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalToleranceDto"}}}}},"security":[{"bearer":[]}],"summary":"Apply an industry tolerance profile to the tenant global tolerances.","tags":["Global Tolerance"]}},"/build/exchange-rates":{"get":{"operationId":"ExchangeRateController_getRate","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Exchange Rates"]}},"/build/exchange-rates/manual/upload":{"post":{"operationId":"ManualFxRateController_upload","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"notes":{"type":"string"}}}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Upload a CSV of manual FX rates (date, currency_code, rate)","tags":["Build - Exchange Rates"]}},"/build/exchange-rates/manual/batches":{"get":{"operationId":"ManualFxRateController_listBatches","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List manual FX upload batches for the tenant","tags":["Build - Exchange Rates"]}},"/build/exchange-rates/manual/audit":{"get":{"operationId":"ManualFxRateController_listAudit","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List manual FX audit entries for the tenant","tags":["Build - Exchange Rates"]}},"/build/exchange-rates/manual/{rateDate}/{currencyCode}":{"delete":{"operationId":"ManualFxRateController_remove","parameters":[{"name":"rateDate","required":true,"in":"path","schema":{"type":"string"}},{"name":"currencyCode","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Remove a manual FX override for a specific date and currency","tags":["Build - Exchange Rates"]}},"/controls-monitor":{"get":{"operationId":"ControlsMonitorController_getMonitor","parameters":[{"name":"lob","required":false,"in":"query","description":"Optional insurance LOB filter.","schema":{"type":"string"}},{"name":"from","required":false,"in":"query","description":"Optional inclusive lower bound for detected dates.","schema":{"type":"string"}},{"name":"to","required":false,"in":"query","description":"Optional inclusive upper bound for detected dates.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of rows to return in the items list.","schema":{"default":25,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ControlsMonitorResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get the controls monitor dashboard.","tags":["Controls Monitor"]}},"/controls-monitor/live":{"get":{"operationId":"ControlsMonitorController_live","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Subscribe to live high-severity controls events for the tenant.","tags":["Controls Monitor"]}},"/settings/entity-fx-configs":{"get":{"operationId":"EntityFxConfigController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityFxConfigListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List per-entity FX configs (base currency and conversion method).","tags":["Entity FX Config"]}},"/settings/entity-fx-configs/{entityId}":{"put":{"operationId":"EntityFxConfigController_upsert","parameters":[{"name":"entityId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertEntityFxConfigDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityFxConfigDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or update the FX config for a legal entity.","tags":["Entity FX Config"]}},"/settings/lob-approver-routes":{"get":{"operationId":"LobApproverRouteController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LobApproverRouteDto"}}}}}},"security":[{"bearer":[]}],"summary":"List LOB approver routes for the current tenant.","tags":["LOB Approver Routes"]}},"/settings/lob-approver-routes/{lobCode}":{"put":{"operationId":"LobApproverRouteController_upsert","parameters":[{"name":"lobCode","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertLobApproverRouteDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LobApproverRouteDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or update an LOB approver route.","tags":["LOB Approver Routes"]},"delete":{"operationId":"LobApproverRouteController_delete","parameters":[{"name":"lobCode","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete an LOB approver route.","tags":["LOB Approver Routes"]}},"/settings/lob-tolerance":{"get":{"operationId":"LobToleranceController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LobToleranceRuleDto"}}}}}},"security":[{"bearer":[]}],"summary":"List LOB tolerance rules for the current tenant.","tags":["LOB Tolerance"]}},"/settings/lob-tolerance/{lobCode}/{matchType}":{"put":{"operationId":"LobToleranceController_upsert","parameters":[{"name":"lobCode","required":true,"in":"path","schema":{"type":"string"}},{"name":"matchType","required":true,"in":"path","schema":{"enum":["TWO_WAY","THREE_WAY","FOUR_WAY"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertLobToleranceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LobToleranceRuleDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or update an LOB tolerance rule.","tags":["LOB Tolerance"]},"delete":{"operationId":"LobToleranceController_delete","parameters":[{"name":"lobCode","required":true,"in":"path","schema":{"type":"string"}},{"name":"matchType","required":true,"in":"path","schema":{"enum":["TWO_WAY","THREE_WAY","FOUR_WAY"],"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete an LOB tolerance rule.","tags":["LOB Tolerance"]}},"/settings/lob-tolerance/history/export":{"get":{"operationId":"LobToleranceController_exportHistory","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Download the LOB tolerance rule change history as an RFC-4180 CSV.","tags":["LOB Tolerance"]}},"/purchase-orders":{"post":{"operationId":"PurchaseOrderController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePurchaseOrderDto"}}}},"responses":{"201":{"description":"Purchase order created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Create a new purchase order","tags":["Purchase Orders"]},"get":{"operationId":"PurchaseOrderController_findAll","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of POs to return","schema":{"type":"number"}},{"name":"orderDateBefore","required":false,"in":"query","description":"Filter POs ordered before this date (YYYY-MM-DD)","schema":{"format":"date","type":"string"}},{"name":"orderDateAfter","required":false,"in":"query","description":"Filter POs ordered after this date (YYYY-MM-DD)","schema":{"format":"date","type":"string"}},{"name":"supplierId","required":false,"in":"query","description":"Filter by supplier ID","schema":{"format":"uuid","type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by PO status","schema":{"enum":["PENDING","SUBMITTED","RECEIVED","CANCELLED","PARTIALLY_INVOICED","FULLY_INVOICED"],"type":"string"}},{"name":"q","required":false,"in":"query","description":"Search by PO number or supplier name","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved list of purchase orders.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrdersPaginatedResponseDto"}}}},"400":{"description":"Bad Request: Invalid filter parameters."},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"List purchase orders with optional filters and pagination","tags":["Purchase Orders"]}},"/purchase-orders/integration-status":{"get":{"operationId":"PurchaseOrderController_integrationStatus","parameters":[],"responses":{"200":{"description":"Successfully retrieved purchase orders with provider mapping, status, and sync/writeback events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderIntegrationStatusResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List purchase orders with accounting provider integration status","tags":["Purchase Orders"]}},"/purchase-orders/{id}/retry-writeback":{"post":{"operationId":"PurchaseOrderController_retryWriteback","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryPurchaseOrderWritebackDto"}}}},"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"summary":"Enqueue a purchase order match writeback repair task","tags":["Purchase Orders"]}},"/purchase-orders/{id}/download":{"get":{"operationId":"PurchaseOrderController_download","parameters":[{"name":"id","required":true,"in":"path","description":"ID of the purchase order","schema":{"format":"string","type":"string"}}],"responses":{"200":{"description":"Successfully generated purchase order PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request: Invalid ID format."},"401":{"description":"Unauthorized."},"404":{"description":"Not Found: Purchase order not found."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Download a purchase order PDF","tags":["Purchase Orders"]}},"/purchase-orders/{id}":{"get":{"operationId":"PurchaseOrderController_findOne","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the purchase order","schema":{"format":"string","type":"string"}}],"responses":{"200":{"description":"Successfully retrieved purchase order details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseDto"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized."},"404":{"description":"Not Found: Purchase order not found."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get a specific purchase order by its ID","tags":["Purchase Orders"]},"patch":{"operationId":"PurchaseOrderController_update","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the purchase order","schema":{"format":"string","type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePurchaseOrderDto"}}}},"responses":{"200":{"description":"Successfully updated purchase order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseDto"}}}},"400":{"description":"Bad Request: Invalid input data or UUID format."},"401":{"description":"Unauthorized."},"404":{"description":"Not Found: Purchase order not found."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Update purchase order header details","tags":["Purchase Orders"]},"delete":{"operationId":"PurchaseOrderController_archive","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the purchase order","schema":{"format":"string","type":"string"}}],"responses":{"200":{"description":"Successfully archived purchase order."},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized."},"404":{"description":"Not Found: Purchase order not found."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Archive (soft delete) a purchase order","tags":["Purchase Orders"]}},"/purchase-orders/{id}/invoice-history":{"get":{"operationId":"PurchaseOrderController_invoiceHistory","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the purchase order","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get the invoice/partial-billing history for a purchase order","tags":["Purchase Orders"]}},"/purchase-orders/generate-number":{"get":{"operationId":"PurchaseOrderController_generatePONumber","parameters":[{"name":"supplierName","required":false,"in":"query","description":"Optional supplier name to include as prefix in PO number","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully generated unique PO number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratePONumberResponse"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Generate a unique PO number for a new purchase order","tags":["Purchase Orders"]}},"/build/purchase-orders":{"post":{"operationId":"BuildPurchaseOrderController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildPoDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Purchase Orders"]},"get":{"operationId":"BuildPurchaseOrderController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Purchase Orders"]}},"/build/purchase-orders/{id}":{"get":{"operationId":"BuildPurchaseOrderController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Purchase Orders"]},"patch":{"operationId":"BuildPurchaseOrderController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBuildPoDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Purchase Orders"]}},"/build/quickbooks-desktop/connections":{"post":{"operationId":"QuickBooksDesktopController_createConnection","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]},"get":{"operationId":"QuickBooksDesktopController_listConnections","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/rotate-password":{"post":{"operationId":"QuickBooksDesktopController_rotatePassword","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/qwc":{"get":{"operationId":"QuickBooksDesktopController_downloadQwc","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/diagnostics":{"get":{"operationId":"QuickBooksDesktopController_diagnostics","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/import":{"post":{"operationId":"QuickBooksDesktopController_queueImport","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"full","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/reconcile":{"post":{"operationId":"QuickBooksDesktopController_queueReconciliation","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/retry-failed":{"post":{"operationId":"QuickBooksDesktopController_retryFailed","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}/documents/{documentId}/writeback":{"post":{"operationId":"QuickBooksDesktopController_writebackDocument","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/connections/{id}":{"delete":{"operationId":"QuickBooksDesktopController_disconnect","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - QuickBooks Desktop"]}},"/build/quickbooks-desktop/wc":{"post":{"operationId":"QuickBooksDesktopController_webConnector","parameters":[{"name":"soapaction","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Build - QuickBooks Desktop"]}},"/settings/semantic-training-governance":{"get":{"operationId":"SemanticFeedbackController_getTrainingGovernance","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingGovernanceDto"}}}}},"security":[{"bearer":[]}],"summary":"Get semantic model training governance settings.","tags":["Semantic Training Governance"]},"put":{"operationId":"SemanticFeedbackController_updateTrainingGovernance","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTrainingGovernanceDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingGovernanceDto"}}}}},"security":[{"bearer":[]}],"summary":"Update semantic model training governance settings.","tags":["Semantic Training Governance"]}},"/engagement/survey-eligibility":{"get":{"operationId":"SurveyController_getSurveyEligibility","parameters":[],"responses":{"200":{"description":"Survey eligibility data."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Check if tenant is eligible for a survey","tags":["Engagement"]}},"/engagement/survey":{"post":{"operationId":"SurveyController_submitSurvey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitSurveyDto"}}}},"responses":{"201":{"description":"Survey response saved."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Submit a survey response (e.g. PMF, NPS)","tags":["Engagement"]}},"/public/engagement/demo-bookings":{"post":{"operationId":"EngagementPublicController_createDemoBooking","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDemoBookingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoBookingAcceptedDto"}}}}},"summary":"Record a server-confirmed demo booking (canonical demo_booked event). Idempotent on bookingReference.","tags":["Public Engagement"]}},"/engagement/ad-conversions":{"get":{"operationId":"AttributionController_getAdConversions","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Return recent server-confirmed registration receipts for this tenant.","tags":["Engagement"]}},"/engagement/activation-timeline":{"get":{"operationId":"AttributionController_getActivationTimeline","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationTimelineDto"}}}}},"security":[{"bearer":[]}],"summary":"Activation timeline (REV-018): milestone timestamps from signup to confirmed writeback, with retriable failure states.","tags":["Engagement"]}},"/engagement/attribution/session":{"post":{"operationId":"AttributionController_recordSessionTouch","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoBookingAttributionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTouchAcceptedDto"}}}}},"security":[{"bearer":[]}],"summary":"Record a qualifying session touch for the authenticated tenant.","tags":["Engagement"]}},"/support/profile":{"get":{"operationId":"SupportController_getProfile","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportProfileDto"}}}}},"security":[{"bearer":[]}],"summary":"Get support profile for the current tenant.","tags":["Support"]}},"/support/tickets":{"get":{"operationId":"SupportController_listTickets","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List support tickets for the current tenant.","tags":["Support"]},"post":{"operationId":"SupportController_createTicket","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportTicketDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a support ticket.","tags":["Support"]}},"/support/tickets/{id}/messages":{"get":{"operationId":"SupportController_getMessages","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketDto"}}}}},"security":[{"bearer":[]}],"summary":"Get a support ticket with messages.","tags":["Support"]},"post":{"operationId":"SupportController_createMessage","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupportTicketMessageDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketDto"}}}}},"security":[{"bearer":[]}],"summary":"Append a message to a support ticket.","tags":["Support"]}},"/admin/support/tickets":{"get":{"operationId":"AdminSupportController_listTickets","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List platform support tickets.","tags":["Admin - Support"]}},"/admin/support/tickets/{id}":{"patch":{"operationId":"AdminSupportController_updateTicket","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupportTicketDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketDto"}}}}},"security":[{"bearer":[]}],"summary":"Update support ticket status, priority, or assignment.","tags":["Admin - Support"]}},"/admin/customers/{id}/support-profile":{"patch":{"operationId":"AdminSupportController_updateSupportProfile","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupportProfileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportProfileDto"}}}}},"security":[{"bearer":[]}],"summary":"Update support profile for a customer.","tags":["Admin - Support"]}},"/admin/customers/{id}/onboarding-plan":{"patch":{"operationId":"AdminSupportController_updateOnboardingPlan","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEnterpriseOnboardingPlanDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseOnboardingPlanDto"}}}}},"security":[{"bearer":[]}],"summary":"Update enterprise onboarding plan for a customer.","tags":["Admin - Support"]}},"/public/support/email-capture":{"post":{"operationId":"PublicSupportController_captureEmail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMarketingEmailCaptureDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSupportAcceptedDto"}}}}},"summary":"Capture a marketing email lead and send the requested resource via email.","tags":["Public Support"]}},"/public/support/email-capture/confirm":{"post":{"operationId":"PublicSupportController_confirmEmailPost","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmMarketingEmailDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmMarketingEmailResponseDto"}}}}},"summary":"Confirm a marketing email capture subscription token.","tags":["Public Support"]},"get":{"deprecated":true,"operationId":"PublicSupportController_confirmEmail","parameters":[{"name":"token","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmMarketingEmailResponseDto"}}}}},"summary":"Deprecated. Use POST email-capture/confirm.","tags":["Public Support"]}},"/public/support/contact":{"post":{"operationId":"PublicSupportController_contact","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicInquiryDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSupportAcceptedDto"}}}}},"summary":"Accept a public demo/contact request from the marketing website and notify the team.","tags":["Public Support"]}},"/admin/partners":{"get":{"operationId":"PartnerController_list","parameters":[{"name":"status","required":false,"in":"query","schema":{"enum":["ACTIVE","PAUSED","ARCHIVED"],"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List partners with referral/deal counts.","tags":["Admin - Partners"]},"post":{"operationId":"PartnerController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePartnerDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Create a partner (generates its referral code).","tags":["Admin - Partners"]}},"/admin/partners/{id}":{"patch":{"operationId":"PartnerController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePartnerDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update a partner (status, rev-share, contacts).","tags":["Admin - Partners"]}},"/admin/partners/report":{"get":{"operationId":"PartnerController_report","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Referral revenue report: referred tenants, active MRR (Stripe authority), partner share.","tags":["Admin - Partners"]}},"/admin/partners/deal-registrations":{"get":{"operationId":"PartnerController_listDeals","parameters":[{"name":"partnerId","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"enum":["SUBMITTED","APPROVED","REJECTED","EXPIRED","CONVERTED"],"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List deal registrations.","tags":["Admin - Partners"]},"post":{"operationId":"PartnerController_registerDeal","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDealDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Register a partner-sourced deal (dedupes active domains).","tags":["Admin - Partners"]}},"/admin/partners/deal-registrations/{id}":{"patch":{"operationId":"PartnerController_decideDeal","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideDealDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Approve or reject a submitted deal registration.","tags":["Admin - Partners"]}},"/integrations/quickbooks/auth-url":{"get":{"operationId":"QuickBooksController_getAuthUrl","parameters":[{"name":"redirectUri","required":false,"in":"query","description":"Custom redirect URI after OAuth completion","schema":{"type":"string"}},{"name":"allowMultiple","required":false,"in":"query","description":"Allow connecting multiple QuickBooks companies (default: false)","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OAuth authorization URL generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksAuthUrlResponse"}}}},"400":{"description":"QuickBooks already connected"}},"security":[{"bearer":[]}],"summary":"Get QuickBooks OAuth authorization URL","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/callback":{"post":{"operationId":"QuickBooksController_handleCallback","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksCallbackDto"}}}},"responses":{"200":{"description":"QuickBooks connected successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksOAuthSuccessResponse"}}}},"401":{"description":"Invalid OAuth state or code"}},"security":[{"bearer":[]}],"summary":"Handle QuickBooks OAuth callback","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/connection":{"get":{"operationId":"QuickBooksController_getConnection","parameters":[],"responses":{"200":{"description":"Connection details retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksConnectionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get QuickBooks connection details (single, backwards compatible)","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/connections":{"get":{"operationId":"QuickBooksController_getConnections","parameters":[],"responses":{"200":{"description":"All connections retrieved","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksConnectionResponse"}}}}}},"security":[{"bearer":[]}],"summary":"Get all QuickBooks connections (multi-company support)","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/connection/{realmId}":{"get":{"operationId":"QuickBooksController_getConnectionByRealmId","parameters":[{"name":"realmId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Connection details retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksConnectionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get QuickBooks connection by realm ID","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/status":{"get":{"operationId":"QuickBooksController_getSyncStatus","parameters":[],"responses":{"200":{"description":"Sync status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksSyncStatusResponse"}}}},"404":{"description":"QuickBooks connection not found"}},"security":[{"bearer":[]}],"summary":"Get QuickBooks sync status","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/sync":{"post":{"operationId":"QuickBooksController_triggerSync","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksTriggerSyncDto"}}}},"responses":{"200":{"description":"Sync triggered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksTriggerSyncResponse"}}}},"400":{"description":"Sync already in progress"},"404":{"description":"QuickBooks connection not found"}},"security":[{"bearer":[]}],"summary":"Trigger QuickBooks sync","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/connections/{connectionId}/sync":{"post":{"operationId":"QuickBooksController_triggerSyncForConnection","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksTriggerSyncDto"}}}},"responses":{"200":{"description":"Sync triggered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksTriggerSyncResponse"}}}}},"security":[{"bearer":[]}],"summary":"Trigger QuickBooks sync for a specific company","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/connections/{connectionId}/reset":{"post":{"operationId":"QuickBooksController_resetConnection","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetQuickBooksConnectionRequest"}}}},"responses":{"200":{"description":"QuickBooks reset queued successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksResetResponse"}}}}},"security":[{"bearer":[]}],"summary":"Reset tenant operational data and re-sync QuickBooks from a cutoff date","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/reset-jobs/{resetJobId}":{"get":{"operationId":"QuickBooksController_getResetStatus","parameters":[{"name":"resetJobId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Reset job status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksResetStatusResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get QuickBooks reset job status","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/disconnect":{"delete":{"operationId":"QuickBooksController_disconnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectQuickBooksDto"}}}},"responses":{"204":{"description":"QuickBooks disconnected successfully"},"404":{"description":"QuickBooks connection not found"}},"security":[{"bearer":[]}],"summary":"Disconnect QuickBooks integration","tags":["QuickBooks Integration"]}},"/integrations/quickbooks/connections/{connectionId}":{"delete":{"operationId":"QuickBooksController_disconnectConnection","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectQuickBooksDto"}}}},"responses":{"204":{"description":"QuickBooks company disconnected successfully"}},"security":[{"bearer":[]}],"summary":"Disconnect a specific QuickBooks company integration","tags":["QuickBooks Integration"]}},"/quickbooks-appstore/launch":{"get":{"operationId":"QuickBooksAppStoreController_launch","parameters":[{"name":"realmId","required":true,"in":"query","description":"QuickBooks company ID","schema":{"type":"string"}},{"name":"app","required":false,"in":"query","description":"App identifier (e.g., quickbooks, fund)","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to app or OAuth flow"}},"summary":"Launch URL for QuickBooks App Store","tags":["QuickBooks App Store"]}},"/quickbooks-appstore/disconnect":{"get":{"operationId":"QuickBooksAppStoreController_disconnect","parameters":[{"name":"realmId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to disconnect confirmation page"}},"summary":"Disconnect landing page for QuickBooks portal disconnects","tags":["QuickBooks App Store"]}},"/quickbooks-appstore/siiwi/auth-url":{"get":{"operationId":"QuickBooksAppStoreController_getSIIWIAuthUrl","parameters":[{"name":"tenantId","required":false,"in":"query","description":"Tenant ID for the session","schema":{"type":"string"}},{"name":"realmId","required":false,"in":"query","description":"QuickBooks company ID (for App Store launch)","schema":{"type":"string"}},{"name":"app","required":false,"in":"query","description":"App identifier (e.g., quickbooks, fund)","schema":{"type":"string"}},{"name":"redirectUri","required":false,"in":"query","description":"Custom redirect URI after SIIWI","schema":{"type":"string"}},{"name":"utm_source","required":false,"in":"query","description":"UTM source for attribution tracking","schema":{"type":"string"}},{"name":"utm_medium","required":false,"in":"query","description":"UTM medium for attribution tracking","schema":{"type":"string"}},{"name":"utm_campaign","required":false,"in":"query","description":"UTM campaign for attribution tracking","schema":{"type":"string"}}],"responses":{"200":{"description":"SIIWI authorization URL"}},"summary":"Get Sign-In with Intuit authorization URL","tags":["QuickBooks App Store"]}},"/quickbooks-appstore/siiwi/callback":{"get":{"operationId":"QuickBooksAppStoreController_handleSIIWICallback","parameters":[{"name":"code","required":true,"in":"query","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","schema":{"type":"string"}},{"name":"error","required":true,"in":"query","schema":{"type":"string"}},{"name":"error_description","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to app after successful SIIWI"},"400":{"description":"Email not verified"},"401":{"description":"Invalid state or code"}},"summary":"Handle Sign-In with Intuit callback","tags":["QuickBooks App Store"]}},"/quickbooks-appstore/connection-status":{"get":{"operationId":"QuickBooksAppStoreController_getConnectionStatus","parameters":[{"name":"realmId","required":true,"in":"query","description":"QuickBooks company ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Connection status"}},"summary":"Check connection status for a QuickBooks realm","tags":["QuickBooks App Store"]}},"/funds/summary":{"get":{"operationId":"FundController_getSummary","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundSummaryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get fund balance summary","tags":["Funds"]}},"/funds":{"get":{"operationId":"FundController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List funds","tags":["Funds"]},"post":{"operationId":"FundController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundCreateRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a fund","tags":["Funds"]}},"/funds/{id}":{"get":{"operationId":"FundController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get a fund by ID","tags":["Funds"]},"patch":{"operationId":"FundController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundUpdateRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update a fund","tags":["Funds"]},"delete":{"operationId":"FundController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a fund","tags":["Funds"]}},"/fund-allocations":{"get":{"operationId":"FundAllocationController_list","parameters":[{"name":"fundId","required":false,"in":"query","schema":{"type":"string"}},{"name":"unlinked","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundAllocationListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List fund allocations","tags":["Fund Allocations"]}},"/fund-allocations/sync":{"post":{"operationId":"FundAllocationController_syncAllocations","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundAllocationSyncRequest"}}}},"responses":{"200":{"description":"Sync started"}},"security":[{"bearer":[]}],"summary":"Sync fund allocations from QuickBooks","tags":["Fund Allocations"]}},"/fund-settings":{"get":{"operationId":"FundSettingsController_getSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundSettingsEnvelope"}}}}},"security":[{"bearer":[]}],"summary":"Get fund settings","tags":["Fund Settings"]},"patch":{"operationId":"FundSettingsController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundSettingsUpdateRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundSettingsEnvelope"}}}}},"security":[{"bearer":[]}],"summary":"Update fund settings","tags":["Fund Settings"]}},"/fund-rules":{"get":{"operationId":"FundRuleController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundRuleListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List fund rules","tags":["Fund Rules"]},"post":{"operationId":"FundRuleController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundRuleCreateRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundRuleResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a fund rule","tags":["Fund Rules"]}},"/fund-rules/{id}":{"delete":{"operationId":"FundRuleController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a fund rule","tags":["Fund Rules"]}},"/fund-reports/statement-of-financial-position":{"get":{"operationId":"FundReportController_exportStatementOfFinancialPosition","parameters":[{"name":"format","required":false,"in":"query","schema":{"enum":["csv","pdf"],"type":"string"}}],"responses":{"200":{"description":"Export file"}},"security":[{"bearer":[]}],"summary":"Export Statement of Financial Position","tags":["Fund Reports"]}},"/fund-reports/statement-of-activities":{"get":{"operationId":"FundReportController_exportStatementOfActivities","parameters":[{"name":"format","required":false,"in":"query","schema":{"enum":["csv","pdf"],"type":"string"}},{"name":"from","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"Export file"}},"security":[{"bearer":[]}],"summary":"Export Statement of Activities","tags":["Fund Reports"]}},"/fund-reports/statement-of-functional-expenses":{"get":{"operationId":"FundReportController_exportStatementOfFunctionalExpenses","parameters":[{"name":"format","required":false,"in":"query","schema":{"enum":["csv","pdf"],"type":"string"}},{"name":"from","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"Export file"}},"security":[{"bearer":[]}],"summary":"Export Statement of Functional Expenses","tags":["Fund Reports"]}},"/grants/summary":{"get":{"operationId":"GrantController_getSummary","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantSummaryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get grant summary","tags":["Grants"]}},"/grants":{"get":{"operationId":"GrantController_findAll","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List grants","tags":["Grants"]},"post":{"operationId":"GrantController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCreateRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a grant","tags":["Grants"]}},"/grants/{id}":{"get":{"operationId":"GrantController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get a grant by ID","tags":["Grants"]},"patch":{"operationId":"GrantController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUpdateRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update a grant","tags":["Grants"]},"delete":{"operationId":"GrantController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a grant","tags":["Grants"]}},"/grants/{id}/budgets":{"get":{"operationId":"GrantController_listBudgets","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBudgetLineListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List grant budget lines","tags":["Grants"]},"post":{"operationId":"GrantController_createBudget","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBudgetLineCreateRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBudgetLineResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a grant budget line","tags":["Grants"]}},"/grants/{id}/budgets/{budgetId}":{"delete":{"operationId":"GrantController_removeBudget","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"budgetId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a grant budget line","tags":["Grants"]}},"/grants/{id}/reminders":{"get":{"operationId":"GrantController_listReminders","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantReminderListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List grant reminders","tags":["Grants"]},"post":{"operationId":"GrantController_createReminder","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantReminderCreateRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantReminderResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a grant reminder","tags":["Grants"]}},"/grants/{id}/reminders/{reminderId}":{"delete":{"operationId":"GrantController_removeReminder","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"reminderId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a grant reminder","tags":["Grants"]}},"/grants/{id}/actuals":{"get":{"operationId":"GrantController_listActuals","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantActualLineListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List grant actual lines","tags":["Grants"]},"post":{"operationId":"GrantController_createActual","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantActualLineCreateRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantActualLineResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a grant actual line","tags":["Grants"]}},"/grants/{id}/actuals/{actualId}":{"delete":{"operationId":"GrantController_removeActual","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"actualId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a grant actual line","tags":["Grants"]}},"/chart-of-accounts":{"get":{"operationId":"ChartOfAccountsController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List chart of accounts entries","tags":["Chart Of Accounts"]},"post":{"operationId":"ChartOfAccountsController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChartOfAccountRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountEntryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a manual chart of accounts entry","tags":["Chart Of Accounts"]}},"/chart-of-accounts/{id}":{"patch":{"operationId":"ChartOfAccountsController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChartOfAccountRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountEntryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update a manual chart of accounts entry","tags":["Chart Of Accounts"]},"delete":{"operationId":"ChartOfAccountsController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a manual chart of accounts entry","tags":["Chart Of Accounts"]}},"/chart-of-accounts/import":{"post":{"operationId":"ChartOfAccountsController_import","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncChartOfAccountsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Import chart of accounts from CSV","tags":["Chart Of Accounts"]}},"/chart-of-accounts/sync":{"post":{"operationId":"ChartOfAccountsController_sync","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncChartOfAccountsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Sync chart of accounts from the connected ERP","tags":["Chart Of Accounts"]}},"/coding-recommendations":{"get":{"operationId":"LearnedDefaultsController_list","parameters":[{"name":"status","required":false,"in":"query","schema":{"enum":["PROPOSED","ACCEPTED","REJECTED"],"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List learned-default recommendations for the tenant.","tags":["Coding Recommendations"]}},"/coding-recommendations/generate":{"post":{"operationId":"LearnedDefaultsController_generate","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Mine the tenant document history and (re)generate PROPOSED recommendations.","tags":["Coding Recommendations"]}},"/coding-recommendations/{id}/accept":{"post":{"operationId":"LearnedDefaultsController_accept","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Accept a recommendation — creates the ordinary Aequo rule (vendor coding default / workflow rule).","tags":["Coding Recommendations"]}},"/coding-recommendations/{id}/reject":{"post":{"operationId":"LearnedDefaultsController_reject","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRecommendationDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Reject a recommendation — retained as feedback, never re-proposed.","tags":["Coding Recommendations"]}},"/build/lien-waivers/{id}/esign-request":{"post":{"operationId":"LienWaiverController_esignRequest","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/esign-callback":{"post":{"operationId":"LienWaiverController_esignCallback","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers":{"post":{"operationId":"LienWaiverController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLienWaiverDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]},"get":{"operationId":"LienWaiverController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/templates":{"get":{"operationId":"LienWaiverController_getTemplates","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/templates/{stateCode}":{"get":{"operationId":"LienWaiverController_getStateTemplate","parameters":[{"name":"stateCode","required":true,"in":"path","schema":{"type":"string"}},{"name":"waiverType","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/compliance-check":{"get":{"operationId":"LienWaiverController_complianceCheck","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/requirements/list":{"get":{"operationId":"LienWaiverController_findRequirements","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/settings/config":{"get":{"operationId":"LienWaiverController_getSettings","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]},"patch":{"operationId":"LienWaiverController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLienWaiverSettingsDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/requirements/{requirementId}/override":{"patch":{"operationId":"LienWaiverController_overrideRequirement","parameters":[{"name":"requirementId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverrideWaiverRequirementDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}":{"get":{"operationId":"LienWaiverController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]},"patch":{"operationId":"LienWaiverController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLienWaiverDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]},"delete":{"operationId":"LienWaiverController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/generate-form":{"get":{"operationId":"LienWaiverController_generateForm","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/download-form":{"get":{"operationId":"LienWaiverController_downloadForm","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/signed-document/download":{"get":{"operationId":"LienWaiverController_downloadSignedDocument","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/receive":{"patch":{"operationId":"LienWaiverController_receive","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/verify":{"post":{"operationId":"LienWaiverController_verify","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyLienWaiverDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]},"patch":{"operationId":"LienWaiverController_verifyLegacy","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyLienWaiverDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/lien-waivers/{id}/reject":{"post":{"operationId":"LienWaiverController_reject","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectLienWaiverDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Lien Waivers"]}},"/build/subcontractor":{"get":{"operationId":"SubcontractorPortalController_getPortalData","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/subcontractor/invoices":{"post":{"operationId":"SubcontractorPortalController_submitInvoice","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/SubmitSubInvoiceDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/subcontractor/lien-waivers":{"post":{"operationId":"SubcontractorPortalController_uploadLienWaiver","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadSubLienWaiverDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/subcontractor/insurance-certificates":{"post":{"operationId":"SubcontractorPortalController_uploadCoi","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadSubCoiDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/subcontractor/w9":{"post":{"operationId":"SubcontractorPortalController_submitW9","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitSubW9Dto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/subcontractor/change-orders/{id}/acknowledge":{"post":{"operationId":"SubcontractorPortalController_acknowledgeChangeOrder","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcknowledgeChangeOrderDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/subcontractor/lien-waivers/{id}/sign":{"post":{"operationId":"SubcontractorPortalController_returnLienWaiverSignature","parameters":[{"name":"authorization","required":true,"in":"header","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignSubLienWaiverDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontractor Portal"]}},"/build/portal-links":{"get":{"operationId":"PortalLinksController_findAll","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Portal Links"]},"post":{"operationId":"PortalLinksController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePortalLinkDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Portal Links"]}},"/build/portal-links/{id}/revoke":{"patch":{"operationId":"PortalLinksController_revoke","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Portal Links"]}},"/build/portal-links/{id}/reactivate":{"patch":{"operationId":"PortalLinksController_reactivate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Portal Links"]}},"/build/portal-links/{id}":{"delete":{"operationId":"PortalLinksController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Portal Links"]}},"/erp-connector/foundation/import-entities":{"post":{"operationId":"ErpConnectorController_foundationImport","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationImportDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationImportResponse"}}}}},"security":[{"bearer":[]}],"summary":"Import FOUNDATION list exports (vendors, jobs, cost codes) from CSV text","tags":["ERP Connector"]}},"/erp-connector/foundation/export-payables":{"post":{"operationId":"ErpConnectorController_foundationExport","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushPayablesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationExportResponse"}}}}},"security":[{"bearer":[]}],"summary":"Build the FOUNDATION AP-invoice import file for approved documents (gated file export — NOT an acknowledged writeback)","tags":["ERP Connector"]}},"/erp-connector/providers":{"get":{"operationId":"ErpConnectorController_listProviders","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProvidersResponse"}}}}},"security":[{"bearer":[]}],"summary":"List registered ERP connector providers","tags":["ERP Connector"]}},"/erp-connector/readiness":{"get":{"operationId":"ErpConnectorController_listReadiness","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorReadinessResponse"}}}}},"security":[{"bearer":[]}],"summary":"ERP connector programme readiness (REV-025): per-connector capability stages and the derived marketing gate","tags":["ERP Connector"]}},"/erp-connector/catalog":{"get":{"operationId":"ErpConnectorController_getCatalog","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Connectable ERP providers with their credential fields, this tenant's connection state and readiness","tags":["ERP Connector"]}},"/erp-connector/test":{"post":{"operationId":"ErpConnectorController_testConnection","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestConnectionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Test connectivity to an ERP provider and persist config on success","tags":["ERP Connector"]}},"/erp-connector/{provider}/status":{"get":{"operationId":"ErpConnectorController_getStatus","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorStatusResponse"}}}}},"security":[{"bearer":[]}],"summary":"Check whether a saved ERP connector config exists for this tenant","tags":["ERP Connector"]}},"/erp-connector/{provider}/sync-vendors":{"post":{"operationId":"ErpConnectorController_syncVendors","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSyncResultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Pull vendors from ERP and sync to Aequo suppliers","tags":["ERP Connector"]}},"/erp-connector/{provider}/sync-coa":{"post":{"operationId":"ErpConnectorController_syncChartOfAccounts","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSyncResultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Pull chart of accounts from ERP and sync to Aequo","tags":["ERP Connector"]}},"/erp-connector/{provider}/sync-jobs":{"post":{"description":"Only for connectors that implement pullJobs/pullCostCodes (Procore). Jobs are matched on the ERP external id (then adopted by job number, then created); cost codes merge into the tenant-wide catalog by code. Idempotent; per-section pull failures are reported in that section's errors.","operationId":"ErpConnectorController_syncJobs","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpJobCatalogSyncResponse"}}}}},"security":[{"bearer":[]}],"summary":"Pull projects/jobs and cost codes from the ERP into Aequo Build jobs and the cost-code catalog","tags":["ERP Connector"]}},"/erp-connector/{provider}/push-payables":{"post":{"operationId":"ErpConnectorController_pushPayables","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushPayablesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSyncResultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Push approved payables to the ERP","tags":["ERP Connector"]}},"/erp-connector/{provider}/diagnostics":{"get":{"operationId":"ErpConnectorController_getDiagnostics","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Connection health, writeback counts, recent failures and reconciliation findings for one provider","tags":["ERP Connector"]}},"/erp-connector/{provider}/reconcile":{"post":{"operationId":"ErpConnectorController_reconcile","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Reconcile pushed bills against the ERP now: resolve unconfirmed pushes and check for drift","tags":["ERP Connector"]}},"/erp-connector/{provider}/retry-failed":{"post":{"operationId":"ErpConnectorController_retryFailed","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpSyncResultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Re-push invoices whose writeback FAILED (never ones awaiting reconciliation)","tags":["ERP Connector"]}},"/erp-connector/{provider}":{"delete":{"operationId":"ErpConnectorController_disconnect","parameters":[{"name":"provider","required":true,"in":"path","description":"ERP provider name","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Disconnect an ERP provider (stops sync and writeback)","tags":["ERP Connector"]}},"/erp-connector/procore/oauth/authorize-url":{"get":{"operationId":"ProcoreOAuthController_getAuthorizeUrl","parameters":[{"name":"returnTo","required":false,"in":"query","description":"Absolute URL to land on after Procore sign-in (e.g. the Aequo Build Procore settings page). Its origin must match APP_URL, FRONTEND_URL, WEB_APP_URL, BUILD_APP_URL, PROCORE_OAUTH_SUCCESS_REDIRECT or an entry in PROCORE_OAUTH_RETURN_ORIGINS; otherwise 400. Omitted: PROCORE_OAUTH_SUCCESS_REDIRECT.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreAuthorizeUrlResponse"}}}}},"security":[{"bearer":[]}],"summary":"Build the Procore OAuth authorize URL (signed state) for this tenant","tags":["ERP Connector"]}},"/erp-connector/procore/connection":{"get":{"operationId":"ProcoreServiceAccountController_getConnection","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreConnectionSummaryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Procore connection mode (user / service_account), linked company and project","tags":["ERP Connector"]}},"/erp-connector/procore/connection/service-account":{"post":{"operationId":"ProcoreServiceAccountController_connectServiceAccount","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreServiceAccountConnectDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreConnectionSummaryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Link a Procore company to the Aequo Build service account (requires the app to be installed in Procore and a prior user sign-in)","tags":["ERP Connector"]}},"/erp-connector/procore/connection/user":{"post":{"operationId":"ProcoreServiceAccountController_useUserAuth","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreConnectionSummaryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Switch the Procore connection back to the stored signed-in user's OAuth token","tags":["ERP Connector"]}},"/erp-connector/foundation/file-exchange/batches":{"get":{"operationId":"FoundationFileExchangeController_listBatches","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileExchangeBatchListResponse"}}}}},"security":[{"bearer":[]}],"summary":"Recent FOUNDATION AP-import hand-off batches","tags":["ERP Connector"]}},"/erp-connector/foundation/file-exchange/batches/{batchId}/file":{"get":{"operationId":"FoundationFileExchangeController_getBatchFile","parameters":[{"name":"batchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileExchangeBatchFileResponse"}}}}},"security":[{"bearer":[]}],"summary":"Re-download the exact file of a batch (recovery for a lost download — never re-export)","tags":["ERP Connector"]}},"/erp-connector/foundation/file-exchange/batches/{batchId}/confirm":{"post":{"operationId":"FoundationFileExchangeController_confirm","parameters":[{"name":"batchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmHandoffDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffActionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Confirm the batch was imported into FOUNDATION (acknowledges the documents’ writeback)","tags":["ERP Connector"]}},"/erp-connector/foundation/file-exchange/batches/{batchId}/void":{"post":{"operationId":"FoundationFileExchangeController_void","parameters":[{"name":"batchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidHandoffDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffActionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Void a batch that was NOT imported, releasing its invoices for re-export","tags":["ERP Connector"]}},"/erp-connector/foundation/file-exchange/import-results":{"post":{"operationId":"FoundationFileExchangeController_importResults","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResultsFileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResultsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Reconcile hand-offs against a FOUNDATION posted-invoices / AP export (vendor + invoice number + amount)","tags":["ERP Connector"]}},"/erp-connector/foundation/file-exchange/diagnostics":{"get":{"operationId":"FoundationFileExchangeController_diagnostics","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileExchangeDiagnosticsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Batches by state, documents awaiting confirmation, last import-results upload and findings","tags":["ERP Connector"]}},"/reinsurance-premium-statements":{"post":{"operationId":"ReinsurancePremiumStatementController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReinsurancePremiumStatementDto"}}}},"responses":{"201":{"description":"Statement created successfully."},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Create a reinsurance premium statement","tags":["Reinsurance Premium Statements"]},"get":{"operationId":"ReinsurancePremiumStatementController_findAll","parameters":[{"name":"vendorId","required":true,"in":"query","schema":{"type":"string"}},{"name":"treatyId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved statements."}},"security":[{"bearer":[]}],"summary":"List reinsurance premium statements for the tenant","tags":["Reinsurance Premium Statements"]}},"/reinsurance-premium-statements/{id}":{"get":{"operationId":"ReinsurancePremiumStatementController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Statement retrieved."},"404":{"description":"Statement not found."}},"security":[{"bearer":[]}],"summary":"Get a reinsurance premium statement by ID","tags":["Reinsurance Premium Statements"]},"patch":{"operationId":"ReinsurancePremiumStatementController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReinsurancePremiumStatementDto"}}}},"responses":{"200":{"description":"Statement updated."},"404":{"description":"Statement not found."}},"security":[{"bearer":[]}],"summary":"Update a reinsurance premium statement","tags":["Reinsurance Premium Statements"]},"delete":{"operationId":"ReinsurancePremiumStatementController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Statement deleted."},"404":{"description":"Statement not found."}},"security":[{"bearer":[]}],"summary":"Delete a reinsurance premium statement","tags":["Reinsurance Premium Statements"]}},"/broker-commission-statements":{"post":{"operationId":"BrokerCommissionStatementController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBrokerCommissionStatementDto"}}}},"responses":{"201":{"description":"Statement created successfully."},"400":{"description":"Bad Request: Invalid input data."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Create a broker commission statement","tags":["Broker Commission Statements"]},"get":{"operationId":"BrokerCommissionStatementController_findAll","parameters":[{"name":"vendorId","required":true,"in":"query","schema":{"type":"string"}},{"name":"treatyId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved statements."}},"security":[{"bearer":[]}],"summary":"List broker commission statements for the tenant","tags":["Broker Commission Statements"]}},"/broker-commission-statements/{id}":{"get":{"operationId":"BrokerCommissionStatementController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Statement retrieved."},"404":{"description":"Statement not found."}},"security":[{"bearer":[]}],"summary":"Get a broker commission statement by ID","tags":["Broker Commission Statements"]},"patch":{"operationId":"BrokerCommissionStatementController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBrokerCommissionStatementDto"}}}},"responses":{"200":{"description":"Statement updated."},"404":{"description":"Statement not found."}},"security":[{"bearer":[]}],"summary":"Update a broker commission statement","tags":["Broker Commission Statements"]},"delete":{"operationId":"BrokerCommissionStatementController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Statement deleted."},"404":{"description":"Statement not found."}},"security":[{"bearer":[]}],"summary":"Delete a broker commission statement","tags":["Broker Commission Statements"]}},"/settings/workflow-automation/rules":{"get":{"operationId":"WorkflowAutomationController_listRules","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAutomationRuleListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List tenant workflow automation rules.","tags":["Workflow Automation"]},"post":{"operationId":"WorkflowAutomationController_createRule","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowAutomationRuleDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAutomationRuleDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a workflow automation rule.","tags":["Workflow Automation"]}},"/settings/workflow-automation/rules/{id}":{"put":{"operationId":"WorkflowAutomationController_updateRule","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowAutomationRuleDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowAutomationRuleDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a workflow automation rule.","tags":["Workflow Automation"]},"delete":{"operationId":"WorkflowAutomationController_deleteRule","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Rule deleted."}},"security":[{"bearer":[]}],"summary":"Delete a workflow automation rule.","tags":["Workflow Automation"]}},"/settings/approval-delegations":{"get":{"operationId":"ApprovalDelegationController_listDelegations","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDelegationListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List approval delegations for the tenant.","tags":["Approval Delegations"]},"post":{"operationId":"ApprovalDelegationController_createDelegation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApprovalDelegationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDelegationDto"}}}}},"security":[{"bearer":[]}],"summary":"Create an approval delegation.","tags":["Approval Delegations"]}},"/settings/approval-delegations/{id}":{"patch":{"operationId":"ApprovalDelegationController_updateDelegation","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApprovalDelegationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDelegationDto"}}}}},"security":[{"bearer":[]}],"summary":"Update an approval delegation.","tags":["Approval Delegations"]},"delete":{"operationId":"ApprovalDelegationController_deleteDelegation","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":"Delegation deleted."}},"security":[{"bearer":[]}],"summary":"Delete an approval delegation.","tags":["Approval Delegations"]}},"/settings/coding-rules/vendor-defaults":{"get":{"operationId":"CodingRulesController_listVendorDefaults","parameters":[{"name":"q","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCodingDefaultListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List vendor coding defaults","tags":["Coding Rules"]},"post":{"operationId":"CodingRulesController_createVendorDefault","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVendorCodingDefaultRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCodingDefaultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a vendor coding default","tags":["Coding Rules"]}},"/settings/coding-rules/vendor-recommendations":{"get":{"operationId":"CodingRulesController_listVendorRecommendations","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List evidence-backed tenant-local vendor coding recommendations","tags":["Coding Rules"]}},"/settings/coding-rules/vendor-recommendations/apply":{"post":{"operationId":"CodingRulesController_applyVendorRecommendation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVendorCodingDefaultRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCodingDefaultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Accept a vendor coding recommendation","tags":["Coding Rules"]}},"/settings/coding-rules/vendor-defaults/{id}":{"patch":{"operationId":"CodingRulesController_updateVendorDefault","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVendorCodingDefaultRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCodingDefaultResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update a vendor coding default","tags":["Coding Rules"]},"delete":{"operationId":"CodingRulesController_deleteVendorDefault","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a vendor coding default","tags":["Coding Rules"]}},"/settings/coding-rules/po-requirement-rules":{"get":{"operationId":"CodingRulesController_listPoRequirementRules","parameters":[{"name":"q","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoRequirementRuleListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List PO requirement rules","tags":["Coding Rules"]},"post":{"operationId":"CodingRulesController_createPoRequirementRule","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePoRequirementRuleRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoRequirementRuleResponse"}}}}},"security":[{"bearer":[]}],"summary":"Create a PO requirement rule","tags":["Coding Rules"]}},"/settings/coding-rules/po-requirement-rules/{id}":{"patch":{"operationId":"CodingRulesController_updatePoRequirementRule","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePoRequirementRuleRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoRequirementRuleResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update a PO requirement rule","tags":["Coding Rules"]},"delete":{"operationId":"CodingRulesController_deletePoRequirementRule","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a PO requirement rule","tags":["Coding Rules"]}},"/settings/coding-rules/ai-settings":{"get":{"operationId":"CodingRulesController_getAiSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodingRuleSettingsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get invoice coding AI settings","tags":["Coding Rules"]},"put":{"operationId":"CodingRulesController_updateAiSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodingRuleSettingsRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodingRuleSettingsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update invoice coding AI settings","tags":["Coding Rules"]}},"/settings/lob-configs":{"get":{"operationId":"LobConfigController_listConfigs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LobConfigListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List per-line-of-business semantic auto-approval settings.","tags":["LOB Config"]},"post":{"operationId":"LobConfigController_createConfig","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLobConfigDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LobConfigDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a new per-LOB semantic approval setting.","tags":["LOB Config"]}},"/settings/lob-configs/{lob}":{"put":{"operationId":"LobConfigController_upsertConfig","parameters":[{"name":"lob","required":true,"in":"path","description":"Insurance line of business key.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertLobConfigDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LobConfigDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or update a per-LOB semantic approval setting.","tags":["LOB Config"]}},"/extraction-accuracy/log":{"post":{"operationId":"ExtractionAccuracyController_logAccuracy","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogDocumentAccuracyRequestDto"}}}},"responses":{"200":{"description":"Corrections logged successfully."}},"security":[{"bearer":[]}],"summary":"Log extraction accuracy corrections for a document","tags":["Extraction Accuracy"]}},"/extraction-accuracy/metrics":{"get":{"operationId":"ExtractionAccuracyController_getMetrics","parameters":[{"name":"from","required":false,"in":"query","description":"Start of date range (ISO8601)","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","description":"End of date range (ISO8601)","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccuracyMetricsResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get extraction accuracy metrics with optional date range","tags":["Extraction Accuracy"]}},"/extraction-accuracy/trend":{"get":{"operationId":"ExtractionAccuracyController_getTrend","parameters":[{"name":"months","required":false,"in":"query","description":"Number of months to look back (default: 6)","schema":{"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccuracyTrendResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get monthly extraction accuracy trend","tags":["Extraction Accuracy"]}},"/cost-anomalies":{"get":{"operationId":"CostAnomalyController_getAnomalies","parameters":[{"name":"documentId","required":false,"in":"query","schema":{"type":"string"}},{"name":"anomalyType","required":false,"in":"query","schema":{"type":"string","enum":["PRICE_SPIKE","PRICE_DROP","DUPLICATE_AMOUNT","UNUSUAL_FREQUENCY","COST_CODE_DEVIATION","NEW_VENDOR_HIGH_VALUE","ROUND_NUMBER"]}},{"name":"severity","required":false,"in":"query","schema":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]}},{"name":"isResolved","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CostAnomalyResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"List cost anomalies with optional filters","tags":["Cost Anomalies"]}},"/cost-anomalies/summary":{"get":{"operationId":"CostAnomalyController_getSummary","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostAnomalySummaryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get cost anomaly summary statistics","tags":["Cost Anomalies"]}},"/cost-anomalies/analyze/{documentId}":{"post":{"operationId":"CostAnomalyController_analyzeDocument","parameters":[{"name":"documentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CostAnomalyResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"Trigger anomaly analysis on a specific document","tags":["Cost Anomalies"]}},"/cost-anomalies/{id}/resolve":{"patch":{"operationId":"CostAnomalyController_resolveAnomaly","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveCostAnomalyDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostAnomalyResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Resolve a cost anomaly with an optional note","tags":["Cost Anomalies"]}},"/ai-services/duplicate-sentinel/{documentId}":{"get":{"operationId":"AiServicesController_duplicates","parameters":[{"name":"documentId","required":true,"in":"path","schema":{"type":"string"}},{"name":"explain","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Fuzzy duplicate + vendor-anomaly detection for a single invoice document. Pass explain=true to include an LLM-generated recommendation and next-steps.","tags":["AI Services"]}},"/ai-services/approval-concierge":{"get":{"operationId":"AiServicesController_approvals","parameters":[{"name":"approverId","required":true,"in":"query","schema":{"type":"string"}},{"name":"explain","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Scored + prioritized pending approval queue for the given approver. Pass explain=true to include per-item summaries and a triage plan.","tags":["AI Services"]}},"/ai-services/close-orchestrator":{"get":{"operationId":"AiServicesController_close","parameters":[{"name":"closeDate","required":true,"in":"query","schema":{"type":"string"}},{"name":"explain","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Period-end close checklist + readiness assessment. Pass explain=true to include a critical-path narrative and time-to-ready estimate.","tags":["AI Services"]}},"/ai-services/coding-copilot/{documentId}":{"post":{"operationId":"AiServicesController_coding","parameters":[{"name":"documentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"LLM-backed GL code suggestions for an uncoded invoice, grounded in tenant chart of accounts + vendor history.","tags":["AI Services"]}},"/integrations":{"get":{"operationId":"IntegrationController_listIntegrations","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor for fetching the next page","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of integrations to return","schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully retrieved list of integrations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationListResponse"}}}},"400":{"description":"Bad Request: Invalid query parameters."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"List connected integrations with pagination","tags":["Integrations"]}},"/integrations/{id}/connection":{"get":{"operationId":"IntegrationController_getIntegrationConnection","parameters":[{"name":"id","required":true,"in":"path","description":"Integration ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Integration connection details."},"400":{"description":"Bad Request: Unsupported integration type."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Integration with the specified ID does not exist."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get connection details for an integration","tags":["Integrations"]}},"/integrations/merge/link-token":{"post":{"operationId":"IntegrationController_getMergeLinkToken","parameters":[],"requestBody":{"required":false,"description":"Optional request body with Merge scopes and integrationId for re-linking","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeLinkTokenRequest"}}}},"responses":{"200":{"description":"Successfully created Merge Link Token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeLinkTokenResponse"}}}},"400":{"description":"Bad Request: Invalid input body."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error communicating with Merge."}},"security":[{"bearer":[]}],"summary":"Create a Merge Link Token for frontend integration setup","tags":["Integrations"]}},"/integrations/merge/exchange-token":{"post":{"operationId":"IntegrationController_exchangeMergeToken","parameters":[],"requestBody":{"required":true,"description":"Public token from Merge Link and optional integration ID for re-linking","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeMergeTokenRequest"}}}},"responses":{"201":{"description":"Successfully exchanged token and created/updated integration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeMergeTokenResponse"}}}},"400":{"description":"Bad Request: Invalid public token or integration ID."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error communicating with Merge."}},"security":[{"bearer":[]}],"summary":"Exchange a Merge public token for an account token and save the integration","tags":["Integrations"]}},"/integrations/{id}":{"delete":{"operationId":"IntegrationController_disconnectIntegration","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the integration to disconnect","schema":{"format":"uuid","type":"string"}},{"name":"wipe","required":false,"in":"query","description":"If true, attempt to delete associated data (default: false)","schema":{"type":"boolean"}}],"responses":{"204":{"description":"Successfully disconnected the integration."},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Integration with the specified ID does not exist."},"500":{"description":"Internal server error during disconnection."}},"security":[{"bearer":[]}],"summary":"Disconnect an integration by its ID","tags":["Integrations"]}},"/integrations/{id}/force-sync":{"post":{"operationId":"IntegrationController_forceSyncIntegration","parameters":[{"name":"id","required":true,"in":"path","description":"UUID of the integration to sync","schema":{"format":"uuid","type":"string"}}],"responses":{"202":{"description":"Synchronization task accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceSyncResponse"}}}},"400":{"description":"Bad Request: Invalid UUID format."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"404":{"description":"Not Found: Integration with the specified ID does not exist."},"500":{"description":"Internal server error triggering sync."}},"security":[{"bearer":[]}],"summary":"Trigger a manual synchronization for an integration","tags":["Integrations"]}},"/integrations/{id}/sync-health":{"get":{"operationId":"IntegrationController_getSyncHealth","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Recent sync health for the integration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncHealthResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get recent sync health and logs for an integration","tags":["Integrations"]}},"/integrations/{id}/sync-health/retry":{"post":{"operationId":"IntegrationController_retrySyncHealth","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"Retry task accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceSyncResponse"}}}}},"security":[{"bearer":[]}],"summary":"Retry the most recent failed or stale sync for an integration","tags":["Integrations"]}},"/integrations/sftp/credentials":{"get":{"operationId":"IntegrationController_getSftpCredentials","parameters":[],"responses":{"200":{"description":"Successfully retrieved SFTP connection details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SftpCredentialsResponse"}}}},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get tenant-provided SFTP connection details","tags":["Integrations"]},"post":{"operationId":"IntegrationController_upsertSftpCredentials","parameters":[],"requestBody":{"required":true,"description":"Tenant-managed SFTP connection details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertSftpCredentialsRequest"}}}},"responses":{"200":{"description":"Successfully saved SFTP credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SftpCredentialsResponse"}}}},"400":{"description":"Bad Request: Invalid SFTP payload."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Save or update tenant-provided SFTP connection details","tags":["Integrations"]}},"/integrations/sftp/yardi/export-batches":{"get":{"operationId":"IntegrationController_listYardiExportBatches","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YardiExportBatchListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List recent Yardi payable export batches","tags":["Integrations"]}},"/integrations/sftp/yardi/export/run":{"post":{"operationId":"IntegrationController_runYardiExport","parameters":[],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunYardiExportResponse"}}}}},"security":[{"bearer":[]}],"summary":"Run a Yardi payable export immediately","tags":["Integrations"]}},"/integrations/sftp/yardi/export-batches/{batchId}/retry":{"post":{"operationId":"IntegrationController_retryYardiExportBatch","parameters":[{"name":"batchId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunYardiExportResponse"}}}}},"security":[{"bearer":[]}],"summary":"Retry a failed Yardi export batch","tags":["Integrations"]}},"/integrations/sftp/yardi/export-batches/{batchId}/confirm":{"post":{"operationId":"IntegrationController_confirmYardiExportBatch","parameters":[{"name":"batchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmHandoffDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffActionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Confirm a Yardi export batch was imported into Voyager (acknowledges its invoices)","tags":["Integrations"]}},"/integrations/sftp/yardi/export-batches/{batchId}/void":{"post":{"operationId":"IntegrationController_voidYardiExportBatch","parameters":[{"name":"batchId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidHandoffDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffActionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Void a Yardi export batch that was NOT imported, releasing its invoices for re-export","tags":["Integrations"]}},"/integrations/sftp/yardi/import-results":{"post":{"operationId":"IntegrationController_importYardiResults","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResultsFileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportResultsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Reconcile Yardi export batches against a Voyager posted-invoices export (vendor + invoice number + amount)","tags":["Integrations"]}},"/integrations/sftp/yardi/diagnostics":{"get":{"operationId":"IntegrationController_getYardiDiagnostics","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileExchangeDiagnosticsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Yardi hand-off diagnostics: batches by state, invoices awaiting confirmation, last import-results upload, findings","tags":["Integrations"]}},"/integrations/email-ingestion":{"get":{"operationId":"IntegrationController_getEmailIngestionSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailIngestionSettingsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get email ingestion settings","tags":["Integrations"]},"put":{"operationId":"IntegrationController_updateEmailIngestionSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmailIngestionSettingsRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailIngestionSettingsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Update email ingestion settings","tags":["Integrations"]}},"/integrations/email-ingestion/activity":{"get":{"operationId":"IntegrationController_getEmailIngestionActivity","parameters":[{"name":"limit","required":false,"in":"query","description":"Maximum number of recent events to return","schema":{"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailIngestionActivityResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get recent email ingestion activity","tags":["Integrations"]}},"/integrations/chart-of-accounts":{"get":{"operationId":"IntegrationController_listChartOfAccounts","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChartOfAccountListResponse"}}}}},"security":[{"bearer":[]}],"summary":"List chart of accounts entries","tags":["Integrations"]}},"/integrations/chart-of-accounts/sync":{"post":{"operationId":"IntegrationController_syncChartOfAccounts","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncChartOfAccountsResponse"}}}}},"security":[{"bearer":[]}],"summary":"Sync chart of accounts from the connected accounting source","tags":["Integrations"]}},"/settings/accounting-writeback":{"get":{"operationId":"AccountingWritebackSettingsController_listSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPoWritebackSettingsResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List connector PO match writeback settings.","tags":["Accounting Writeback Settings"]}},"/settings/accounting-writeback/{integrationId}":{"patch":{"operationId":"AccountingWritebackSettingsController_updateSetting","parameters":[{"name":"integrationId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountingPoWritebackSettingDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPoWritebackSettingDto"}}}}},"security":[{"bearer":[]}],"summary":"Update PO match writeback settings for one connector.","tags":["Accounting Writeback Settings"]}},"/settings/accounting-writeback/{integrationId}/retry-failures":{"post":{"operationId":"AccountingWritebackSettingsController_retryFailures","parameters":[{"name":"integrationId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryAccountingPoWritebackFailuresResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Retry failed PO match writebacks for one connector.","tags":["Accounting Writeback Settings"]}},"/webhook/stripe":{"post":{"description":"This endpoint receives event notifications from Stripe and processes them securely using signature verification.","operationId":"WebhookController_handleStripeWebhook","parameters":[{"name":"stripe-signature","in":"header","description":"Stripe webhook signature for verification","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook processed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"403":{"description":"Invalid or missing Stripe signature"},"500":{"description":"Error processing webhook"}},"summary":"Handle inbound webhooks from Stripe","tags":["Webhooks"]}},"/webhook/merge":{"post":{"description":"This endpoint receives event notifications from Merge. Ensure the `Merge-Signature` header is validated against the payload and your Merge signing secret.","operationId":"WebhookController_handleMergeWebhook","parameters":[{"name":"x-merge-webhook-signature","required":true,"in":"header","schema":{"type":"string"}},{"name":"Merge-Signature","in":"header","description":"HMAC signature from Merge to verify payload integrity and authenticity.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Webhook payload from Merge","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeWebhookPayload"}}}},"responses":{"202":{"description":"Webhook received and queued for processing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Bad Request: Invalid payload format."},"403":{"description":"Forbidden: Invalid or missing Merge signature."},"500":{"description":"Internal server error processing webhook."}},"summary":"Handle inbound webhooks from Merge. Requires Merge signature validation.","tags":["Webhooks"]}},"/webhook/clerk":{"post":{"description":"Receives user and organization events from Clerk with Svix signature validation.","operationId":"WebhookController_handleClerkWebhook","parameters":[{"name":"svix-id","required":true,"in":"header","description":"Svix message ID","schema":{"type":"string"}},{"name":"svix-timestamp","required":true,"in":"header","description":"Svix timestamp","schema":{"type":"string"}},{"name":"svix-signature","required":true,"in":"header","description":"Svix signature","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook processed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"403":{"description":"Invalid webhook signature"}},"summary":"Handle inbound webhooks from Clerk","tags":["Webhooks"]}},"/webhook/postmark":{"post":{"description":"This endpoint receives processed email replies. Source validation (e.g., IP check, secret header) is recommended.","operationId":"WebhookController_handleEmailReplyWebhook","parameters":[{"name":"x-inbound-email-webhook-secret","required":true,"in":"header","description":"Shared secret for inbound email webhooks.","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Parsed email reply data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailReplyWebhookPayload"}}}},"responses":{"200":{"description":"Email reply webhook received successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Bad Request: Invalid payload format."},"403":{"description":"Forbidden: Invalid or missing inbound email webhook secret."},"500":{"description":"Internal server error processing email reply."}},"summary":"Handle inbound email replies via webhook (e.g., from SendGrid, Resend)","tags":["Webhooks"]}},"/webhook/email-ingestion":{"post":{"description":"Creates documents from inbound email attachments routed to a tenant-specific AP inbox address.","operationId":"WebhookController_handleInboundEmailIngestion","parameters":[{"name":"x-inbound-email-webhook-secret","required":true,"in":"header","description":"Shared secret for inbound email webhooks.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/EmailReplyWebhookPayload"}}}},"responses":{"200":{"description":"Inbound email processed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"403":{"description":"Forbidden: Invalid or missing inbound email webhook secret."}},"summary":"Handle inbound invoice emails with attachments","tags":["Webhooks"]}},"/webhook/resend-inbound":{"post":{"description":"Receives email.received events from Resend, downloads attachments via the Resend API, and processes them as documents.","operationId":"WebhookController_handleResendInboundEmail","parameters":[{"name":"svix-id","required":true,"in":"header","description":"Svix webhook ID for verification.","schema":{"type":"string"}},{"name":"svix-timestamp","required":true,"in":"header","description":"Svix webhook timestamp for verification.","schema":{"type":"string"}},{"name":"svix-signature","required":true,"in":"header","description":"Svix webhook signature for verification.","schema":{"type":"string"}}],"responses":{"200":{"description":"Resend inbound email processed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"403":{"description":"Forbidden: Invalid webhook signature."}},"summary":"Handle Resend inbound email webhook (email.received)","tags":["Webhooks"]}},"/onboarding/status":{"get":{"description":"Returns the onboarding completion status including plan, integrations, and initial data setup.","operationId":"OnboardingController_getOnboardingStatus","parameters":[],"responses":{"200":{"description":"Onboarding status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"track":{"type":"string","enum":["SETUP","MEMBER_QUICKSTART"]},"hasValidPlan":{"type":"boolean"},"planName":{"type":"string"},"hasIntegrations":{"type":"boolean"},"hasPurchaseOrders":{"type":"boolean"},"hasDocuments":{"type":"boolean"},"completionPercentage":{"type":"number"},"sampleDataSeededAt":{"type":"string","nullable":true},"requiredTaskIds":{"type":"array","items":{"type":"string"}},"completedTaskIds":{"type":"array","items":{"type":"string"}},"checklist":{"type":"array"},"journey":{"type":"object","nullable":true},"isDemo":{"type":"boolean"},"demoExpiresAt":{"type":"string","nullable":true},"trialEndsAt":{"type":"string","nullable":true},"trialPlanCode":{"type":"string","nullable":true},"isTrialExpired":{"type":"boolean"}}}}}}},"security":[{"bearer":[]}],"summary":"Get onboarding status for the current tenant","tags":["Onboarding"]}},"/onboarding/wizard-state":{"get":{"operationId":"OnboardingController_getOnboardingWizardState","parameters":[],"responses":{"200":{"description":"Onboarding wizard state retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingWizardStateResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get role-based onboarding wizard state for the current user","tags":["Onboarding"]}},"/onboarding/sample-data":{"post":{"operationId":"OnboardingController_seedSampleData","parameters":[],"responses":{"200":{"description":"Sample data seed request handled successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedSampleDataResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Seed tenant-scoped sample onboarding data (idempotent).","tags":["Onboarding"]}},"/onboarding/qualification":{"post":{"operationId":"OnboardingController_saveQualification","parameters":[],"responses":{"200":{"description":"Qualification data saved successfully."}},"security":[{"bearer":[]}],"summary":"Save onboarding qualification answers (country, team size, volume, etc.).","tags":["Onboarding"]}},"/onboarding/clear-demo-data":{"post":{"operationId":"OnboardingController_clearDemoData","parameters":[],"responses":{"200":{"description":"Demo data cleared successfully."}},"security":[{"bearer":[]}],"summary":"Clear all demo/sample data for the tenant.","tags":["Onboarding"]}},"/onboarding/services":{"post":{"operationId":"OnboardingController_submitServices","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitServicesRequestDto"}}}},"responses":{"200":{"description":"Services saved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingSuccessResponseDto"}}}},"400":{"description":"Bad Request or validation error."},"404":{"description":"Tenant not found."}},"security":[{"bearer":[]}],"summary":"Submit selected services during onboarding.","tags":["Onboarding"]}},"/onboarding/company-details":{"post":{"operationId":"OnboardingController_submitCompanyDetails","parameters":[],"requestBody":{"required":true,"description":"Company details. The logo is an optional file upload.","content":{"multipart/form-data":{"schema":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"companyName":{"type":"string"},"companyWebsite":{"type":"string","format":"url","nullable":true},"addressLine1":{"type":"string"},"addressLine2":{"type":"string","nullable":true},"addressCity":{"type":"string"},"addressStateProvince":{"type":"string","nullable":true},"addressPostalCode":{"type":"string","nullable":true},"addressCountry":{"type":"string"},"logo":{"type":"string","format":"binary","nullable":true}},"required":["firstName","lastName","email","companyName","addressLine1","addressCity","addressCountry"]}}}},"responses":{"200":{"description":"Company details saved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingSuccessResponseDto"}}}},"400":{"description":"Bad Request or validation error."},"404":{"description":"User or Tenant not found."}},"security":[{"bearer":[]}],"summary":"Submit company details and complete onboarding.","tags":["Onboarding"]}},"/billing/details":{"get":{"operationId":"BillingController_getBillingDetails","parameters":[],"responses":{"200":{"description":"Successfully retrieved billing details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingDetailsResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get tenant's billing details.","tags":["Billing & Usage"]}},"/billing/invoices":{"get":{"operationId":"BillingController_getInvoices","parameters":[],"responses":{"200":{"description":"Successfully retrieved invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get tenant's invoices.","tags":["Billing & Usage"]}},"/billing/portal":{"get":{"operationId":"BillingController_getBillingPortalUrl","parameters":[],"responses":{"200":{"description":"Successfully retrieved billing portal URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPortalResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get tenant's billing portal URL.","tags":["Billing & Usage"]}},"/billing/plans":{"get":{"operationId":"BillingController_getPlans","parameters":[],"responses":{"200":{"description":"Successfully retrieved plans.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get available plans.","tags":["Billing & Usage"]}},"/billing/usage-summary":{"get":{"operationId":"BillingController_getUsageSummary","parameters":[],"responses":{"200":{"description":"Successfully retrieved usage summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get tenant's current usage summary and plan quotas.","tags":["Billing & Usage"]}},"/billing/create-checkout-session":{"post":{"operationId":"BillingController_createCheckoutSession","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionRequestDto"}}}},"responses":{"200":{"description":"Successfully created checkout session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Create Stripe checkout session for plan subscription.","tags":["Billing & Usage"]}},"/billing/handle-checkout-success":{"post":{"operationId":"BillingController_handleCheckoutSuccess","parameters":[],"responses":{"200":{"description":"Successfully processed checkout completion."},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Handle successful checkout session completion.","tags":["Billing & Usage"]}},"/billing/usage-status":{"get":{"description":"Returns comprehensive usage information including current usage vs limits, percentage used, warnings when approaching limits, and enabled features.","operationId":"BillingController_getUsageStatus","parameters":[],"responses":{"200":{"description":"Successfully retrieved usage status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageStatusResponseDto"}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get detailed usage status including all limits, warnings, and billing info.","tags":["Billing & Usage"]}},"/billing/schedule-downgrade":{"post":{"description":"Validates that current usage fits within the target plan limits before scheduling the downgrade.","operationId":"BillingController_schedulePlanDowngrade","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetPlanCode","targetPriceId"],"properties":{"targetPlanCode":{"type":"string","enum":["FREE","TEAM","GROWTH"],"description":"The plan code to downgrade to"},"targetPriceId":{"type":"string","description":"The Stripe price ID for the target plan"}}}}}},"responses":{"200":{"description":"Successfully scheduled plan downgrade.","content":{"application/json":{"schema":{"type":"object","properties":{"scheduledFor":{"type":"string","format":"date-time"},"fromPlan":{"type":"string"},"toPlan":{"type":"string"}}}}}},"400":{"description":"Cannot downgrade due to usage exceeding target plan limits."},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Schedule a plan downgrade for the end of the billing period.","tags":["Billing & Usage"]}},"/billing/scheduled-downgrade":{"delete":{"operationId":"BillingController_cancelScheduledDowngrade","parameters":[],"responses":{"200":{"description":"Successfully cancelled scheduled downgrade."},"401":{"description":"Unauthorized."},"404":{"description":"No scheduled plan change found."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Cancel a scheduled plan downgrade.","tags":["Billing & Usage"]}},"/billing/scheduled-change":{"get":{"operationId":"BillingController_getScheduledPlanChange","parameters":[],"responses":{"200":{"description":"Successfully retrieved scheduled plan change info.","content":{"application/json":{"schema":{"type":"object","properties":{"hasScheduledChange":{"type":"boolean"},"scheduledChange":{"type":"object","properties":{"fromPlan":{"type":"string"},"toPlan":{"type":"string"},"scheduledFor":{"type":"string","format":"date-time"}}}}}}}},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get any scheduled plan changes for the tenant.","tags":["Billing & Usage"]}},"/billing/apps":{"get":{"operationId":"AppBillingController_getAllSubscriptions","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllAppSubscriptionsResponseDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get all app subscriptions for the tenant.","tags":["App Billing"]}},"/billing/apps/{appCode}/plans":{"get":{"operationId":"AppBillingController_getAppPlans","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppPlansResponseDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get available plans for a specific app.","tags":["App Billing"]}},"/billing/apps/{appCode}/subscription":{"get":{"operationId":"AppBillingController_getAppSubscription","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppSubscriptionResponseDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get current subscription for a specific app.","tags":["App Billing"]},"delete":{"operationId":"AppBillingController_cancelSubscription","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}}],"responses":{"200":{"description":"Subscription will cancel at period end."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Cancel an app subscription at period end.","tags":["App Billing"]}},"/billing/apps/{appCode}/checkout-session":{"post":{"operationId":"AppBillingController_createCheckoutSession","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAppCheckoutDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppCheckoutResponseDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Create Stripe checkout session for an app plan.","tags":["App Billing"]}},"/billing/apps/{appCode}/checkout-success":{"post":{"operationId":"AppBillingController_handleCheckoutSuccess","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}}],"responses":{"200":{"description":"Subscription activated."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Handle successful app checkout.","tags":["App Billing"]}},"/billing/apps/{appCode}/subscription/resume":{"post":{"operationId":"AppBillingController_resumeSubscription","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}}],"responses":{"200":{"description":"Subscription resumed."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Resume a cancelled app subscription.","tags":["App Billing"]}},"/billing/apps/{appCode}/portal":{"get":{"operationId":"AppBillingController_getBillingPortal","parameters":[{"name":"appCode","required":true,"in":"path","schema":{"enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"],"type":"string"}},{"name":"returnUrl","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Billing portal URL."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get Stripe billing portal URL for an app.","tags":["App Billing"]}},"/inbox/summary":{"get":{"operationId":"InboxController_summary","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSummaryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Return inbox badge counts for the current tenant","tags":["Inbox"]}},"/inbox":{"get":{"operationId":"InboxController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List open operational work items for the current tenant","tags":["Inbox"]}},"/inbox/{itemId}/actions":{"post":{"operationId":"InboxController_act","parameters":[{"name":"itemId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxItemActionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxItemActionResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Run an action against an inbox work item","tags":["Inbox"]}},"/team/members":{"get":{"operationId":"TeamController_getTeamMembers","parameters":[],"responses":{"200":{"description":"Team members retrieved successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamMemberDto"}}}}}},"security":[{"bearer":[]}],"summary":"Get all team members","tags":["Team"]}},"/team/invites":{"get":{"operationId":"TeamController_getPendingInvites","parameters":[],"responses":{"200":{"description":"Pending invites retrieved successfully.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PendingInviteDto"}}}}}},"security":[{"bearer":[]}],"summary":"Get pending invitations","tags":["Team"]}},"/team/roles-matrix":{"get":{"operationId":"TeamController_getRolesMatrix","parameters":[],"responses":{"200":{"description":"Team roles matrix retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamRolesMatrixDto"}}}}},"security":[{"bearer":[]}],"summary":"Get approval roles, SoD conflicts, and team assignments","tags":["Team"]}},"/team/invite":{"post":{"operationId":"TeamController_inviteMember","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberDto"}}}},"responses":{"201":{"description":"Invitation sent successfully."}},"security":[{"bearer":[]}],"summary":"Invite a new team member","tags":["Team"]}},"/team/invites/{inviteId}":{"delete":{"operationId":"TeamController_cancelInvite","parameters":[{"name":"inviteId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Invitation cancelled successfully."}},"security":[{"bearer":[]}],"summary":"Cancel a pending invitation","tags":["Team"]}},"/team/members/{userId}":{"delete":{"operationId":"TeamController_removeMember","parameters":[{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Team member removed successfully."}},"security":[{"bearer":[]}],"summary":"Remove a team member","tags":["Team"]}},"/team/members/{userId}/approval-roles":{"put":{"operationId":"TeamController_updateMemberApprovalRoles","parameters":[{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserApprovalRolesDto"}}}},"responses":{"200":{"description":"Approval roles updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberDto"}}}}},"security":[{"bearer":[]}],"summary":"Assign approval roles to a team member","tags":["Team"]}},"/team/members/{userId}/role":{"patch":{"operationId":"TeamController_updateMemberRole","parameters":[{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamMemberRoleDto"}}}},"responses":{"200":{"description":"Team member role updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a team member workspace role","tags":["Team"]}},"/team/members/{userId}/transfer-ownership":{"post":{"operationId":"TeamController_transferOwnership","parameters":[{"name":"userId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Ownership transferred successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberDto"}}}}},"security":[{"bearer":[]}],"summary":"Transfer workspace ownership to another member","tags":["Team"]}},"/admin/aws-marketplace/customers":{"get":{"operationId":"AdminAwsMarketplaceController_listCustomers","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page","schema":{"type":"number"}},{"name":"search","required":false,"in":"query","description":"Search by customer ID, AWS account, or tenant name","schema":{"type":"string"}}],"responses":{"200":{"description":"List of AWS Marketplace customers"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List all AWS Marketplace customers","tags":["Admin - AWS Marketplace"]}},"/admin/aws-marketplace/customers/{id}":{"get":{"operationId":"AdminAwsMarketplaceController_getCustomer","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"AWS Marketplace customer details"},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get a specific AWS Marketplace customer","tags":["Admin - AWS Marketplace"]}},"/admin/aws-marketplace/entitlements":{"get":{"operationId":"AdminAwsMarketplaceController_listEntitlements","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page","schema":{"type":"number"}},{"name":"customerIdentifier","required":false,"in":"query","description":"Filter by customer identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"List of AWS Marketplace entitlements"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List all AWS Marketplace entitlements","tags":["Admin - AWS Marketplace"]}},"/admin/aws-marketplace/entitlements/{customerIdentifier}/refresh":{"post":{"operationId":"AdminAwsMarketplaceController_refreshEntitlements","parameters":[{"name":"customerIdentifier","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Entitlements refresh triggered"},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Refresh entitlements for a customer from AWS","tags":["Admin - AWS Marketplace"]}},"/admin/aws-marketplace/metering":{"get":{"operationId":"AdminAwsMarketplaceController_listMeteringRecords","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page","schema":{"type":"number"}},{"name":"customerIdentifier","required":false,"in":"query","description":"Filter by customer identifier","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"enum":["PENDING","SUBMITTED","FAILED","DEDUPLICATED"],"type":"string"}}],"responses":{"200":{"description":"List of metering records"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List AWS Marketplace metering records","tags":["Admin - AWS Marketplace"]}},"/admin/aws-marketplace/metering/summary":{"get":{"operationId":"AdminAwsMarketplaceController_getMeteringSummary","parameters":[],"responses":{"200":{"description":"Metering summary statistics"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get metering summary statistics","tags":["Admin - AWS Marketplace"]}},"/admin/activation/backfill-clerk":{"post":{"operationId":"AdminActivationController_queueBackfill","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationBackfillResponseDto"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Queue a Clerk backfill job for activation sync.","tags":["Admin - Activation"]}},"/admin/activation/summary":{"get":{"operationId":"AdminActivationController_getSummary","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationSummaryDto"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get activation GTM summary metrics.","tags":["Admin - Activation"]}},"/admin/activation/customers":{"get":{"operationId":"AdminActivationController_listCustomers","parameters":[{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"stage","required":false,"in":"query","schema":{"enum":["NEEDS_ACCOUNTING_CONNECTION","NEEDS_BOOTSTRAP_SYNC","NEEDS_QUICKBOOKS","NEEDS_APPROVAL_RULE","NEEDS_FIRST_INVOICE","NEEDS_FIRST_CODED_INVOICE","NEEDS_FIRST_APPROVAL_SUBMISSION","NEEDS_FIRST_APPROVAL_COMPLETION","NEEDS_SECOND_PROCESSED_INVOICE","NEEDS_FIRST_WRITEBACK","WRITEBACK_FAILED","ACTIVATED","SUPPRESSED"],"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationCustomerListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List activation journey customers.","tags":["Admin - Activation"]}},"/admin/activation/customers/{tenantId}":{"get":{"operationId":"AdminActivationController_getCustomer","parameters":[{"name":"tenantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationCustomerDetailDto"}}}},"404":{"description":"Customer not found"}},"security":[{"bearer":[]}],"summary":"Get activation journey detail for a tenant.","tags":["Admin - Activation"]}},"/admin/abm/summary":{"get":{"operationId":"AdminAbmController_getSummary","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadSummaryDto"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get ABM warm-lead summary metrics.","tags":["Admin - ABM"]}},"/admin/abm/leads":{"get":{"operationId":"AdminAbmController_listLeads","parameters":[{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"enum":["PENDING_ENRICHMENT","READY","AUTO_SENT","ENGAGED","PAUSED","DISQUALIFIED","ARCHIVED","NEEDS_REVIEW"],"type":"string"}},{"name":"tier","required":false,"in":"query","schema":{"enum":["HIGH_TOUCH_NOW","HIGH_VALUE_WARM","STANDARD"],"type":"string"}},{"name":"ownerId","required":false,"in":"query","schema":{"type":"string"}},{"name":"confidence","required":false,"in":"query","schema":{"enum":["low","medium","high"],"type":"string"}},{"name":"sequenceStep","required":false,"in":"query","schema":{"enum":["STEP_1","STEP_2","STEP_3"],"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List warm signup ABM leads.","tags":["Admin - ABM"]}},"/admin/abm/leads/{id}":{"get":{"operationId":"AdminAbmController_getLead","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadDetailDto"}}}},"404":{"description":"Lead not found"}},"security":[{"bearer":[]}],"summary":"Get warm lead detail.","tags":["Admin - ABM"]}},"/admin/abm/backfill-recent-signups":{"post":{"operationId":"AdminAbmController_backfillRecentSignups","parameters":[],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadBackfillResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Backfill recent signups into the ABM queue.","tags":["Admin - ABM"]}},"/admin/abm/leads/{id}/status":{"patch":{"operationId":"AdminAbmController_updateStatus","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadStatusUpdateDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadDetailDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a warm lead status.","tags":["Admin - ABM"]}},"/admin/abm/leads/{id}/reassign":{"patch":{"operationId":"AdminAbmController_reassignLead","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadReassignDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadDetailDto"}}}}},"security":[{"bearer":[]}],"summary":"Reassign a warm lead to another sales owner.","tags":["Admin - ABM"]}},"/admin/abm/pool":{"get":{"operationId":"AdminAbmController_listPool","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadPoolMemberDto"}}}}}},"security":[{"bearer":[]}],"summary":"List sales assignment pool members.","tags":["Admin - ABM"]},"post":{"operationId":"AdminAbmController_createPoolMember","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadPoolUpsertDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadPoolMemberDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or update a sales assignment pool member.","tags":["Admin - ABM"]}},"/admin/abm/pool/{id}":{"patch":{"operationId":"AdminAbmController_updatePoolMember","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadPoolUpdateDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadPoolMemberDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a sales assignment pool member.","tags":["Admin - ABM"]}},"/admin/abm/leads/{id}/disposition":{"patch":{"operationId":"AdminAbmController_applyDisposition","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmLeadDispositionDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Apply a structured disposition (REV-012): disqualifies the lead, stops sequences, releases assignments.","tags":["Admin - ABM"]}},"/admin/abm/dispositions/summary":{"get":{"operationId":"AdminAbmController_getDispositionSummary","parameters":[{"name":"days","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Aggregate dispositions by reason/campaign/landing page/ERP for targeting reviews.","tags":["Admin - ABM"]}},"/admin/abm/assignments/{id}/acknowledge":{"post":{"operationId":"AdminAbmController_acknowledgeAssignment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Acknowledge a routed sales assignment (stops SLA escalation; first acknowledgement marks the account SQL).","tags":["Admin - ABM"]}},"/admin/revenue/funnel":{"get":{"operationId":"AdminRevenueController_getFunnel","parameters":[{"name":"period","required":false,"in":"query","schema":{"type":"string","enum":["7d","30d","90d","365d"]}},{"name":"view","required":false,"in":"query","schema":{"type":"string","enum":["period","cohort"]}},{"name":"segmentBy","required":false,"in":"query","schema":{"type":"string","enum":["campaign","erp","industry","landingPage","plan","intentTheme"]}},{"name":"touch","required":false,"in":"query","schema":{"type":"string","enum":["first","last"]}},{"name":"spendCents","required":false,"in":"query","description":"Ad spend for the window (cents); enables CPL / cost-per-PQL / CAC diagnostics.","schema":{"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Lifecycle-based revenue funnel (Leads → MQL → PQL → SQL → Opportunity → Customer → New MRR/ARR).","tags":["Admin - Revenue"]}},"/admin/revenue/funnel/export":{"get":{"operationId":"AdminRevenueController_exportFunnel","parameters":[{"name":"period","required":false,"in":"query","schema":{"type":"string","enum":["7d","30d","90d","365d"]}},{"name":"view","required":false,"in":"query","schema":{"type":"string","enum":["period","cohort"]}},{"name":"segmentBy","required":false,"in":"query","schema":{"type":"string","enum":["campaign","erp","industry","landingPage","plan","intentTheme"]}},{"name":"touch","required":false,"in":"query","schema":{"type":"string","enum":["first","last"]}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"CSV export of the segmented revenue funnel.","tags":["Admin - Revenue"]}},"/admin/revenue/mrr":{"get":{"operationId":"AdminRevenueController_getMrr","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"MRR/ARR from normalized Stripe subscription data (revenue authority).","tags":["Admin - Revenue"]}},"/admin/revenue/movements":{"get":{"operationId":"AdminRevenueController_getMovements","parameters":[{"name":"period","required":false,"in":"query","schema":{"type":"string","enum":["7d","30d","90d","365d"]}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Event-dated MRR movements (new/expansion/contraction/churn).","tags":["Admin - Revenue"]}},"/admin/revenue/stripe/reconcile":{"post":{"operationId":"AdminRevenueController_reconcileStripe","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Re-pull all Stripe subscriptions into normalized revenue rows (backfill/reconciliation).","tags":["Admin - Revenue"]}},"/admin/revenue/outbox":{"get":{"operationId":"AdminRevenueController_listOutbox","parameters":[{"name":"destination","required":false,"in":"query","schema":{"type":"string","enum":["CRM","GOOGLE_ADS","OPENAI_ADS"]}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["PENDING","PROCESSING","DELIVERED","FAILED","DEAD_LETTER","SKIPPED"]}},{"name":"tenantId","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"minimum":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Inspect revenue outbox deliveries (payloads redacted).","tags":["Admin - Revenue"]}},"/admin/revenue/outbox/summary":{"get":{"operationId":"AdminRevenueController_outboxSummary","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Outbox delivery counts by destination and status.","tags":["Admin - Revenue"]}},"/admin/revenue/outbox/{id}/replay":{"post":{"operationId":"AdminRevenueController_replayOutbox","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Row requeued for delivery."}},"security":[{"bearer":[]}],"summary":"Replay a FAILED/DEAD_LETTER/SKIPPED outbox delivery (409 for any other status).","tags":["Admin - Revenue"]}},"/admin/revenue/pql/backfill":{"post":{"operationId":"AdminRevenueController_backfillPql","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Re-evaluate PQL levels for all tenants from activation milestones.","tags":["Admin - Revenue"]}},"/admin/revenue/connector-readiness":{"get":{"operationId":"AdminRevenueController_getConnectorReadiness","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"ERP connector programme readiness (REV-025) — the gate for marketing \"live integration\" claims.","tags":["Admin - Revenue"]}},"/admin/revenue/lifecycle/{tenantId}":{"get":{"operationId":"AdminRevenueController_getLifecycle","parameters":[{"name":"tenantId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Lifecycle state + full transition history for a tenant.","tags":["Admin - Revenue"]}},"/admin/revenue/opportunities":{"post":{"operationId":"AdminRevenueController_createOpportunity","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOpportunityDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Open a commercial opportunity for a tenant (manual, pre-CRM).","tags":["Admin - Revenue"]}},"/admin/revenue/opportunities/close":{"post":{"operationId":"AdminRevenueController_closeOpportunity","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseOpportunityDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Close an opportunity as won or lost.","tags":["Admin - Revenue"]}},"/admin/customers":{"get":{"operationId":"AdminCustomersController_listCustomers","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page (max 100)","schema":{"type":"number"}},{"name":"search","required":false,"in":"query","description":"Search by name or email","schema":{"type":"string"}},{"name":"plan","required":false,"in":"query","description":"Filter by plan code","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"enum":["active","trialing","at-risk","churned"],"type":"string"}}],"responses":{"200":{"description":"List of customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerListResponseDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List all customers (tenants)","tags":["Admin - Customers"]},"post":{"operationId":"AdminCustomersController_createCustomer","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerCreateDTO"}}}},"responses":{"201":{"description":"Customer created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Create a new customer","tags":["Admin - Customers"]}},"/admin/customers/{id}":{"get":{"operationId":"AdminCustomersController_getCustomer","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Customer detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerDetailDTO"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get customer detail","tags":["Admin - Customers"]},"put":{"operationId":"AdminCustomersController_updateCustomer","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerUpdateDTO"}}}},"responses":{"200":{"description":"Customer updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerDTO"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Update a customer","tags":["Admin - Customers"]},"delete":{"operationId":"AdminCustomersController_deleteCustomer","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Customer deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Delete a customer","tags":["Admin - Customers"]}},"/admin/customers/{id}/message/preview":{"post":{"operationId":"AdminCustomersController_previewMessage","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerMessagePreviewRequestDTO"}}}},"responses":{"200":{"description":"Generated email preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerMessagePreviewResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Generate a GPT-crafted draft email for selected customer users.","tags":["Admin - Customers"]}},"/admin/customers/{id}/message/send":{"post":{"operationId":"AdminCustomersController_sendMessage","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerMessageSendRequestDTO"}}}},"responses":{"200":{"description":"Email send result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerMessageSendResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Send an email to selected customer users.","tags":["Admin - Customers"]}},"/admin/customers/{id}/reset-trial":{"post":{"operationId":"AdminCustomersController_resetTrial","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Trial reset result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerTrialResetResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Reset the customer trial to a fresh 14-day Growth trial and send confirmation emails.","tags":["Admin - Customers"]}},"/admin/customers/{id}/extend-trial":{"post":{"operationId":"AdminCustomersController_extendTrial","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Trial extension result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTrialExtensionResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Extend the trial to 30 days from trial start after an attended setup call. Idempotent: runs at most once per tenant.","tags":["Admin - Customers"]}},"/admin/customers/{id}/demo-bookings":{"get":{"operationId":"AdminCustomersController_listDemoBookings","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminDemoBookingDTO"}}}}}},"security":[{"bearer":[]}],"summary":"Demo/setup-call bookings linked to this customer (by tenant or user email).","tags":["Admin - Customers"]}},"/admin/customers/{id}/demo-bookings/{bookingId}/attendance":{"post":{"operationId":"AdminCustomersController_markDemoBookingAttendance","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"bookingId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDemoBookingAttendanceRequestDTO"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDemoBookingAttendanceResponseDTO"}}}}},"security":[{"bearer":[]}],"summary":"Mark a setup call attended (extends the trial to 30 days) or a no-show (default trial stays).","tags":["Admin - Customers"]}},"/admin/dashboard/summary":{"get":{"operationId":"AdminDashboardController_getPlatformSummary","parameters":[],"responses":{"200":{"description":"Platform summary metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDashboardSummaryDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get platform-wide dashboard summary","tags":["Admin - Dashboard"]}},"/admin/dashboard/conversion-funnel":{"get":{"operationId":"AdminDashboardController_getConversionFunnel","parameters":[{"name":"period","required":false,"in":"query","description":"Time period (default: 30d)","schema":{"enum":["7d","30d","90d"],"type":"string"}}],"responses":{"200":{"description":"Conversion funnel data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionFunnelDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get conversion funnel metrics","tags":["Admin - Dashboard"]}},"/admin/dashboard/mrr":{"get":{"operationId":"AdminDashboardController_getMrr","parameters":[],"responses":{"200":{"description":"Monthly recurring revenue data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MrrDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get MRR breakdown","tags":["Admin - Dashboard"]}},"/admin/email-sequences/summary":{"get":{"operationId":"AdminEmailSequencesController_getSummary","parameters":[],"responses":{"200":{"description":"Email sequence summary KPIs"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get email sequence KPI summary","tags":["Admin - Email Sequences"]}},"/admin/email-sequences/by-type":{"get":{"operationId":"AdminEmailSequencesController_getByType","parameters":[],"responses":{"200":{"description":"Email sequence stats by type"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get email sequence breakdown by type","tags":["Admin - Email Sequences"]}},"/admin/email-sequences/timeline":{"get":{"operationId":"AdminEmailSequencesController_getTimeline","parameters":[],"responses":{"200":{"description":"Daily email send counts by type"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get email sequence timeline (last 30 days)","tags":["Admin - Email Sequences"]}},"/admin/email-sequences/customers":{"get":{"operationId":"AdminEmailSequencesController_getCustomers","parameters":[{"name":"search","required":false,"in":"query","description":"Search by name","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","description":"Filter by demo or trial","schema":{"enum":["demo","trial"],"type":"string"}},{"name":"activity","required":false,"in":"query","description":"Filter by activity level","schema":{"enum":["active","inactive"],"type":"string"}},{"name":"converted","required":false,"in":"query","description":"Filter by conversion status","schema":{"enum":["true","false"],"type":"string"}},{"name":"page","required":false,"in":"query","description":"Page number (default: 1)","schema":{"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page (default: 20)","schema":{"type":"number"}}],"responses":{"200":{"description":"Paginated list of customers in sequences"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List customers in email sequences","tags":["Admin - Email Sequences"]}},"/admin/email-sequences/customers/{id}":{"get":{"operationId":"AdminEmailSequencesController_getCustomerDetail","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Customer email history"},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get customer email sequence detail","tags":["Admin - Email Sequences"]}},"/admin/exceptions":{"get":{"operationId":"AdminExceptionsController_listExceptions","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page","schema":{"type":"number"}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"enum":["OPEN","INVESTIGATING","AWAITING_VENDOR","PENDING_SUPPLIER","RESOLUTION_PROPOSED","ESCALATED","RESOLVED"],"type":"string"}},{"name":"customerId","required":false,"in":"query","description":"Filter by customer/tenant ID","schema":{"type":"string"}}],"responses":{"200":{"description":"List of exceptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminExceptionListResponseDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List all exceptions across all tenants","tags":["Admin - Exceptions"]}},"/admin/integrations":{"get":{"operationId":"AdminIntegrationsController_listIntegrations","parameters":[{"name":"cursor","required":false,"in":"query","description":"Pagination cursor","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Number of items per page","schema":{"type":"number"}},{"name":"status","required":false,"in":"query","description":"Filter by status","schema":{"enum":["PENDING","CONNECTED","SYNCING","ERROR","DISCONNECTED"],"type":"string"}},{"name":"customerId","required":false,"in":"query","description":"Filter by customer/tenant ID","schema":{"type":"string"}}],"responses":{"200":{"description":"List of integrations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIntegrationListResponseDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"List all integrations across all tenants","tags":["Admin - Integrations"]}},"/admin/onboarding/analytics":{"get":{"operationId":"AdminOnboardingController_getAnalytics","parameters":[],"responses":{"200":{"description":"Onboarding analytics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOnboardingAnalyticsDTO"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get platform-wide onboarding analytics","tags":["Admin - Onboarding"]}},"/admin/onboarding/stuck":{"get":{"operationId":"AdminOnboardingController_getStuckCustomers","parameters":[{"name":"threshold","required":false,"in":"query","description":"Number of days to consider a customer stuck (default: 7)","schema":{"type":"number"}}],"responses":{"200":{"description":"List of stuck customers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StuckCustomerDTO"}}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get customers stuck in onboarding","tags":["Admin - Onboarding"]}},"/admin/onboarding/customers/{id}":{"get":{"operationId":"AdminOnboardingController_getCustomerOnboarding","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Customer onboarding status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomerOnboardingDTO"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Customer not found"},"500":{"description":"Internal server error"}},"security":[{"bearer":[]}],"summary":"Get onboarding status for a specific customer","tags":["Admin - Onboarding"]}},"/admin/operations/audit":{"get":{"operationId":"AdminOperationsController_listAudit","parameters":[{"name":"limit","required":false,"in":"query","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}},{"name":"tenantId","required":false,"in":"query","schema":{"type":"string"}},{"name":"userId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAuditListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List admin audit events for the current tenant.","tags":["Admin - Operations"]}},"/admin/operations/users":{"get":{"operationId":"AdminOperationsController_listUsers","parameters":[{"name":"limit","required":false,"in":"query","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"tenantId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List users for admin bulk operations.","tags":["Admin - Operations"]}},"/admin/operations/users/bulk-role":{"post":{"operationId":"AdminOperationsController_bulkUpdateRoles","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUserRoleUpdateRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUserRoleUpdateResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Bulk update user roles.","tags":["Admin - Operations"]}},"/admin/operations/permissions/simulate":{"post":{"operationId":"AdminOperationsController_simulatePermissions","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionSimulationRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionSimulationResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Simulate permission checks for a role/action pair.","tags":["Admin - Operations"]}},"/admin/operations/observability/status":{"get":{"operationId":"AdminOperationsController_getStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminObservabilityStatusDto"}}}}},"security":[{"bearer":[]}],"summary":"Get top-level observability status for the current tenant.","tags":["Admin - Operations"]}},"/admin/operations/observability/incidents":{"get":{"operationId":"AdminOperationsController_listIncidents","parameters":[{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminIncidentListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List recent incident timeline entries.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics":{"get":{"operationId":"AdminOperationsController_listQuickBooksDiagnostics","parameters":[{"name":"tenantId","required":false,"in":"query","schema":{"type":"string"}},{"name":"provider","required":false,"in":"query","schema":{"type":"string","enum":["quickbooks","xero","freshbooks","zoho"]}},{"name":"connectionId","required":false,"in":"query","schema":{"type":"string"}},{"name":"invoiceNumber","required":false,"in":"query","schema":{"type":"string"}},{"name":"billId","required":false,"in":"query","schema":{"type":"string"}},{"name":"poNumber","required":false,"in":"query","schema":{"type":"string"}},{"name":"supplier","required":false,"in":"query","schema":{"type":"string"}},{"name":"skipReason","required":false,"in":"query","schema":{"type":"string","enum":["NO_LINKED_PO","MULTIPLE_LINKED_POS","PO_MAPPING_MISSING","DOCUMENT_NOT_READY","MATCH_EXISTS","MISSING_PO_REQUIRED","PO_OPTIONAL_APPLIED","SUPPLIER_NOT_MAPPED","STALE_OCR_FAILURE_STATE","MATCH_TASK_MISSING","MATCH_TASK_FAILED","READY_TO_MATCH"]}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"dateFrom","required":false,"in":"query","schema":{"type":"string"}},{"name":"dateTo","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","schema":{"type":"string","enum":["updatedAt","createdAt","documentDate"]}},{"name":"sortDirection","required":false,"in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List QuickBooks bill matching diagnostics.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics/telemetry":{"get":{"operationId":"AdminOperationsController_getQuickBooksDiagnosticTelemetry","parameters":[{"name":"tenantId","required":false,"in":"query","schema":{"type":"string"}},{"name":"provider","required":false,"in":"query","schema":{"type":"string","enum":["quickbooks","xero","freshbooks","zoho"]}},{"name":"connectionId","required":false,"in":"query","schema":{"type":"string"}},{"name":"invoiceNumber","required":false,"in":"query","schema":{"type":"string"}},{"name":"billId","required":false,"in":"query","schema":{"type":"string"}},{"name":"poNumber","required":false,"in":"query","schema":{"type":"string"}},{"name":"supplier","required":false,"in":"query","schema":{"type":"string"}},{"name":"skipReason","required":false,"in":"query","schema":{"type":"string","enum":["NO_LINKED_PO","MULTIPLE_LINKED_POS","PO_MAPPING_MISSING","DOCUMENT_NOT_READY","MATCH_EXISTS","MISSING_PO_REQUIRED","PO_OPTIONAL_APPLIED","SUPPLIER_NOT_MAPPED","STALE_OCR_FAILURE_STATE","MATCH_TASK_MISSING","MATCH_TASK_FAILED","READY_TO_MATCH"]}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"dateFrom","required":false,"in":"query","schema":{"type":"string"}},{"name":"dateTo","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","schema":{"type":"string","enum":["updatedAt","createdAt","documentDate"]}},{"name":"sortDirection","required":false,"in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"limit","required":false,"in":"query","schema":{"type":"number"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticTelemetryResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Aggregate QuickBooks matching skip-reason telemetry.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics/templates":{"get":{"operationId":"AdminOperationsController_listQuickBooksDiagnosticTemplates","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticTemplateListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List editable customer-safe diagnostic templates.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics/templates/{code}":{"patch":{"operationId":"AdminOperationsController_updateQuickBooksDiagnosticTemplate","parameters":[{"name":"code","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateQuickBooksDiagnosticTemplateRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticTemplateListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a customer-safe diagnostic template.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics/{documentId}":{"get":{"operationId":"AdminOperationsController_getQuickBooksDiagnosticDetail","parameters":[{"name":"documentId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticDetailDto"}}}}},"security":[{"bearer":[]}],"summary":"Get detailed QuickBooks bill matching diagnostics.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics/{documentId}/repair":{"post":{"operationId":"AdminOperationsController_repairQuickBooksDiagnostic","parameters":[{"name":"documentId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticRepairRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticRepairResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Run a repair action for a QuickBooks bill diagnostic.","tags":["Admin - Operations"]}},"/admin/operations/qbo-diagnostics/bulk-repair":{"post":{"operationId":"AdminOperationsController_bulkRepairQuickBooksDiagnostics","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticBulkRepairRequestDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickBooksDiagnosticBulkRepairResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Preview or run a bulk QuickBooks diagnostic repair.","tags":["Admin - Operations"]}},"/admin/search-terms/import":{"post":{"operationId":"SearchTermsController_importTerms","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportSearchTermsDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Import a search-term report (idempotent on term+campaign).","tags":["Admin - Search Terms"]}},"/admin/search-terms/classify":{"post":{"operationId":"SearchTermsController_classify","parameters":[{"name":"limit","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Classify pending terms with the LLM (model + prompt version recorded).","tags":["Admin - Search Terms"]}},"/admin/search-terms":{"get":{"operationId":"SearchTermsController_list","parameters":[{"name":"status","required":false,"in":"query","schema":{"enum":["PENDING_REVIEW","APPROVED","REJECTED"],"type":"string"}},{"name":"classification","required":false,"in":"query","schema":{"enum":["COMMERCIAL","ERP","PROBLEM","COMPETITOR","RESEARCH","JOB_SEEKER","SUPPORT","IRRELEVANT"],"type":"string"}},{"name":"proposedNegative","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List search terms with classification + review state.","tags":["Admin - Search Terms"]}},"/admin/search-terms/{id}/review":{"patch":{"operationId":"SearchTermsController_review","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSearchTermDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Approve or reject a classification/negative-keyword proposal (human decision).","tags":["Admin - Search Terms"]}},"/admin/search-terms/negatives/export":{"get":{"operationId":"SearchTermsController_exportNegatives","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"CSV of human-approved negative keywords for manual upload to the ads console.","tags":["Admin - Search Terms"]}},"/company-access":{"get":{"description":"Returns all companies (QuickBooks connections) the current user can access","operationId":"CompanyAccessController_getAccessibleCompanies","parameters":[],"responses":{"200":{"description":"List of accessible companies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get accessible companies","tags":["Company Access"]}},"/company-access/stats":{"get":{"description":"Returns document/supplier/PO counts per company","operationId":"CompanyAccessController_getCompanyStats","parameters":[],"responses":{"200":{"description":"Company statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyStatsResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get company statistics","tags":["Company Access"]}},"/company-access/{companyId}":{"get":{"description":"Returns details for a specific company","operationId":"CompanyAccessController_getCompany","parameters":[{"name":"companyId","required":true,"in":"path","description":"QuickBooks connection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Company details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyDto"}}}},"404":{"description":"Company not found"}},"security":[{"bearer":[]}],"summary":"Get company details","tags":["Company Access"]}},"/company-access/{companyId}/users":{"get":{"description":"Returns all users with access to a specific company","operationId":"CompanyAccessController_getCompanyUsers","parameters":[{"name":"companyId","required":true,"in":"path","description":"QuickBooks connection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"List of users with access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyUsersResponseDto"}}}},"403":{"description":"Admin access required"},"404":{"description":"Company not found"}},"security":[{"bearer":[]}],"summary":"Get company users","tags":["Company Access"]}},"/company-access/{companyId}/users/{userId}":{"post":{"description":"Grants a user access to a specific company","operationId":"CompanyAccessController_grantAccess","parameters":[{"name":"companyId","required":true,"in":"path","description":"QuickBooks connection ID","schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","description":"User ID to grant access to","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCompanyAccessDto"}}}},"responses":{"201":{"description":"Access granted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyAccessResponseDto"}}}},"403":{"description":"Admin access required"},"404":{"description":"Company or user not found"},"409":{"description":"User already has access"}},"security":[{"bearer":[]}],"summary":"Grant user access to company","tags":["Company Access"]},"put":{"description":"Updates a user's access level for a specific company","operationId":"CompanyAccessController_updateAccess","parameters":[{"name":"companyId","required":true,"in":"path","description":"QuickBooks connection ID","schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","description":"User ID to update","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCompanyAccessDto"}}}},"responses":{"200":{"description":"Access updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyAccessResponseDto"}}}},"403":{"description":"Admin access required"},"404":{"description":"Access record not found"}},"security":[{"bearer":[]}],"summary":"Update user access level","tags":["Company Access"]},"delete":{"description":"Revokes a user's access to a specific company","operationId":"CompanyAccessController_revokeAccess","parameters":[{"name":"companyId","required":true,"in":"path","description":"QuickBooks connection ID","schema":{"type":"string"}},{"name":"userId","required":true,"in":"path","description":"User ID to revoke access from","schema":{"type":"string"}}],"responses":{"200":{"description":"Access revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"403":{"description":"Admin access required"},"404":{"description":"Access record not found"}},"security":[{"bearer":[]}],"summary":"Revoke user access","tags":["Company Access"]}},"/reporting/dashboard":{"get":{"description":"Returns aggregated dashboard stats with per-company breakdown when viewing all companies","operationId":"ReportingController_getDashboardStats","parameters":[],"responses":{"200":{"description":"Consolidated dashboard statistics"}},"security":[{"bearer":[]}],"summary":"Get consolidated dashboard stats","tags":["Reporting"]}},"/reporting/export":{"get":{"operationId":"ReportingController_exportReport","parameters":[{"name":"reportType","required":true,"in":"query","schema":{"enum":["EXCEPTION_AGING","APPROVAL_AUDIT_TRAIL","VENDOR_PAYMENT_HISTORY","MATCH_ACCURACY","SEGREGATION_OF_DUTIES","GL_CODING_SUMMARY"],"type":"string"}},{"name":"from","required":true,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":true,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"format","required":false,"in":"query","schema":{"enum":["CSV","PDF"],"type":"string"}}],"responses":{"200":{"description":"Export for the requested report."}},"security":[{"bearer":[]}],"summary":"Export a governance report as CSV or PDF","tags":["Reporting"]}},"/reporting/list-export":{"get":{"operationId":"ReportingController_exportList","parameters":[{"name":"resource","required":true,"in":"query","schema":{"enum":["DOCUMENTS","EXCEPTIONS"],"type":"string"}},{"name":"from","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":false,"in":"query","schema":{"type":"string"}},{"name":"matchId","required":false,"in":"query","schema":{"type":"string"}},{"name":"slaFrom","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"slaTo","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"CSV export for a filtered list resource."}},"security":[{"bearer":[]}],"summary":"Export documents or exceptions lists as CSV","tags":["Reporting"]}},"/reporting/internal-audit-export":{"get":{"operationId":"ReportingController_exportInternalAudit","parameters":[{"name":"from","required":false,"in":"query","schema":{"format":"date-time","type":"string"}},{"name":"to","required":false,"in":"query","schema":{"format":"date-time","type":"string"}}],"responses":{"200":{"description":"Streaming CSV export for internal audit evidence."}},"security":[{"bearer":[]}],"summary":"Stream the Internal Audit evidence export as CSV","tags":["Reporting"]}},"/dashboard/summary":{"get":{"operationId":"DashboardController_getDashboardSummary","parameters":[],"responses":{"200":{"description":"Dashboard summary data retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardSummaryDTO"}}}},"401":{"description":"Unauthorized"}},"security":[{"bearer":[]}],"summary":"Get dashboard summary metrics","tags":["Dashboard"]}},"/export":{"get":{"operationId":"ExportController_getExports","parameters":[{"name":"from","required":true,"in":"query","description":"Start date (ISO8601) for the export range (inclusive)","schema":{"format":"date-time","type":"string"}},{"name":"to","required":true,"in":"query","description":"End date (ISO8601) for the export range (inclusive)","schema":{"format":"date-time","type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter exports by match status","schema":{"enum":["CLEARED","CLEARED_MANUAL","EXCEPTION","PENDING_SUPPLIER"],"type":"string"}}],"responses":{"200":{"description":"Successfully streams the gzipped CSV export. The response headers specify the filename and content type.","content":{"application/gzip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request: Invalid filter parameters (e.g., date format)."},"401":{"description":"Unauthorized: Invalid or missing authentication token."},"500":{"description":"Internal server error during data generation or streaming."}},"security":[{"bearer":[]}],"summary":"Export match data as a gzipped CSV file based on filters","tags":["Export"]}},"/build/wip-reports":{"post":{"operationId":"WipReportController_generate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateWipReportDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - WIP Reports"]},"get":{"operationId":"WipReportController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - WIP Reports"]}},"/build/wip-reports/{id}":{"get":{"operationId":"WipReportController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - WIP Reports"]}},"/integrations/xero/auth-url":{"get":{"operationId":"XeroController_getAuthUrl","parameters":[],"responses":{"200":{"description":""}},"tags":["Xero"]}},"/integrations/xero/callback":{"get":{"operationId":"XeroController_handleCallback","parameters":[],"responses":{"200":{"description":""}},"tags":["Xero"]}},"/integrations/xero/connections":{"get":{"operationId":"XeroController_getConnections","parameters":[],"responses":{"200":{"description":""}},"tags":["Xero"]}},"/integrations/xero/connections/{connectionId}":{"get":{"operationId":"XeroController_getConnection","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Xero"]},"delete":{"operationId":"XeroController_disconnect","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"tags":["Xero"]}},"/integrations/xero/connections/{connectionId}/organization":{"get":{"operationId":"XeroController_getOrganization","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Xero"]}},"/integrations/xero/connections/{connectionId}/sync":{"post":{"operationId":"XeroController_triggerSync","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XeroTriggerSyncDto"}}}},"responses":{"200":{"description":""}},"tags":["Xero"]}},"/integrations/xero/connections/{connectionId}/refresh":{"post":{"operationId":"XeroController_refreshTokens","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"tags":["Xero"]}},"/webhooks/xero":{"post":{"operationId":"XeroWebhookController_handleWebhook","parameters":[{"name":"x-xero-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["XeroWebhook"]}},"/integrations/freshbooks/auth-url":{"get":{"operationId":"FreshBooksController_getAuthUrl","parameters":[{"name":"redirectUri","required":false,"in":"query","description":"Custom redirect URI (optional)","schema":{"type":"string"}},{"name":"allowMultiple","required":false,"in":"query","description":"Allow connecting multiple FreshBooks accounts","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OAuth authorization URL generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksAuthUrlResponse"}}}},"400":{"description":"FreshBooks already connected"}},"security":[{"bearer":[]}],"summary":"Get FreshBooks OAuth authorization URL","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/callback":{"get":{"operationId":"FreshBooksController_handleCallback","parameters":[{"name":"code","required":false,"in":"query","description":"Authorization code from OAuth callback","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","description":"State parameter from OAuth callback","schema":{"type":"string"}},{"name":"freshbooksAccountId","required":false,"in":"query","description":"FreshBooks account ID selected from multiple businesses","schema":{"type":"string"}},{"name":"businessUuid","required":false,"in":"query","description":"FreshBooks business UUID selected from multiple businesses","schema":{"type":"string"}},{"name":"selectionToken","required":false,"in":"query","description":"Encrypted continuation token for finalizing a multi-business FreshBooks selection","schema":{"type":"string"}}],"responses":{"200":{"description":"FreshBooks connected successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksOAuthSuccessResponse"}}}},"401":{"description":"Invalid OAuth state or code"}},"security":[{"bearer":[]}],"summary":"Handle FreshBooks OAuth callback","tags":["FreshBooks Integration"]},"post":{"operationId":"FreshBooksController_handleCallbackPost","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksCallbackDto"}}}},"responses":{"200":{"description":"FreshBooks callback processed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksOAuthSuccessResponse"}}}}},"security":[{"bearer":[]}],"summary":"Handle FreshBooks OAuth callback via request body","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/connection":{"get":{"operationId":"FreshBooksController_getConnection","parameters":[],"responses":{"200":{"description":"Connection details retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksConnectionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get FreshBooks connection details","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/connections":{"get":{"operationId":"FreshBooksController_getConnections","parameters":[],"responses":{"200":{"description":"All FreshBooks connections retrieved","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FreshBooksConnectionResponse"}}}}}},"security":[{"bearer":[]}],"summary":"Get all FreshBooks connections","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/status":{"get":{"operationId":"FreshBooksController_getSyncStatus","parameters":[],"responses":{"200":{"description":"Sync status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksSyncStatusResponse"}}}},"404":{"description":"FreshBooks connection not found"}},"security":[{"bearer":[]}],"summary":"Get FreshBooks sync status","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/sync":{"post":{"operationId":"FreshBooksController_triggerSync","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksTriggerSyncDto"}}}},"responses":{"200":{"description":"Sync triggered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksTriggerSyncResponse"}}}},"400":{"description":"Sync already in progress"},"404":{"description":"FreshBooks connection not found"}},"security":[{"bearer":[]}],"summary":"Trigger FreshBooks sync","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/connections/{connectionId}/sync":{"post":{"operationId":"FreshBooksController_triggerSyncForConnection","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreshBooksTriggerSyncDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["FreshBooks Integration"]}},"/integrations/freshbooks/disconnect":{"delete":{"operationId":"FreshBooksController_disconnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectFreshBooksDto"}}}},"responses":{"204":{"description":"FreshBooks disconnected successfully"},"404":{"description":"FreshBooks connection not found"}},"security":[{"bearer":[]}],"summary":"Disconnect FreshBooks integration","tags":["FreshBooks Integration"]}},"/integrations/freshbooks/connections/{connectionId}":{"delete":{"operationId":"FreshBooksController_disconnectConnection","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectFreshBooksDto"}}}},"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"tags":["FreshBooks Integration"]}},"/webhooks/freshbooks":{"post":{"operationId":"FreshBooksWebhookController_handleWebhook","parameters":[{"name":"x-freshbooks-hmac-sha256","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["FreshBooksWebhook"]}},"/integrations/zoho/auth-url":{"get":{"operationId":"ZohoController_getAuthUrl","parameters":[{"name":"redirectUri","required":false,"in":"query","description":"Custom redirect URI (optional)","schema":{"type":"string"}},{"name":"dataCenter","required":false,"in":"query","description":"Zoho data center region (default: US)","schema":{"type":"string","enum":["US","EU","IN","AU","JP"]}}],"responses":{"200":{"description":"OAuth authorization URL generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoAuthUrlResponse"}}}},"400":{"description":"Zoho Books already connected"}},"security":[{"bearer":[]}],"summary":"Get Zoho Books OAuth authorization URL","tags":["Zoho Books Integration"]}},"/integrations/zoho/callback":{"get":{"operationId":"ZohoController_handleCallback","parameters":[{"name":"code","required":true,"in":"query","description":"Authorization code from OAuth callback","schema":{"type":"string"}},{"name":"state","required":true,"in":"query","description":"State parameter from OAuth callback","schema":{"type":"string"}},{"name":"accounts-server","required":false,"in":"query","description":"Account server domain","schema":{"type":"string"}}],"responses":{"200":{"description":"Zoho Books connected successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoOAuthSuccessResponse"}}}},"401":{"description":"Invalid OAuth state or code"}},"security":[{"bearer":[]}],"summary":"Handle Zoho Books OAuth callback","tags":["Zoho Books Integration"]}},"/integrations/zoho/connection":{"get":{"operationId":"ZohoController_getConnection","parameters":[],"responses":{"200":{"description":"Connection details retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoConnectionResponse"}}}}},"security":[{"bearer":[]}],"summary":"Get Zoho Books connection details","tags":["Zoho Books Integration"]}},"/integrations/zoho/status":{"get":{"operationId":"ZohoController_getSyncStatus","parameters":[],"responses":{"200":{"description":"Sync status retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZohoSyncStatusResponse"}}}},"404":{"description":"Zoho Books connection not found"}},"security":[{"bearer":[]}],"summary":"Get Zoho Books sync status","tags":["Zoho Books Integration"]}},"/integrations/zoho/sync":{"post":{"operationId":"ZohoController_triggerSync","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerZohoSyncDto"}}}},"responses":{"200":{"description":"Sync triggered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerZohoSyncResponse"}}}},"400":{"description":"Sync already in progress"},"404":{"description":"Zoho Books connection not found"}},"security":[{"bearer":[]}],"summary":"Trigger Zoho Books sync","tags":["Zoho Books Integration"]}},"/integrations/zoho/disconnect":{"delete":{"operationId":"ZohoController_disconnect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectZohoDto"}}}},"responses":{"204":{"description":"Zoho Books disconnected successfully"},"404":{"description":"Zoho Books connection not found"}},"security":[{"bearer":[]}],"summary":"Disconnect Zoho Books integration","tags":["Zoho Books Integration"]}},"/webhooks/zoho":{"post":{"operationId":"ZohoWebhookController_handleWebhook","parameters":[{"name":"x-zoho-webhook-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["ZohoWebhook"]}},"/public/blog":{"get":{"operationId":"BlogController_listPosts","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BlogPostSummaryDto"}}}}}},"summary":"List published blog posts","tags":["Blog"]}},"/public/blog/{slug}":{"get":{"operationId":"BlogController_getPost","parameters":[{"name":"slug","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPostDetailDto"}}}}},"summary":"Get a blog post by slug","tags":["Blog"]}},"/webhook/outrank/blog":{"post":{"description":"Accepts Outrank content-generated events and upserts publishable posts into the public blog store.","operationId":"BlogOutrankWebhookController_handleWebhook","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"202":{"description":"Webhook processed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"saved":{"type":"number"},"accepted":{"type":"boolean"},"requestId":{"type":"string"},"processedCount":{"type":"number"},"failedCount":{"type":"number"},"received":{"type":"number"},"transformed":{"type":"number"},"fallbackUsed":{"type":"number"}}}}}}},"summary":"Receive Outrank blog content webhooks","tags":["Blog"]}},"/settings/sso-saml":{"get":{"operationId":"SsoSamlController_getSettings","parameters":[],"responses":{"200":{"description":"SSO/SAML settings fetched successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoSamlSettingsDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get tenant SSO/SAML settings and status.","tags":["SSO / SAML"]},"put":{"operationId":"SsoSamlController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSsoSamlSettingsDto"}}}},"responses":{"200":{"description":"SSO/SAML settings updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoSamlSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or update tenant SSO/SAML settings.","tags":["SSO / SAML"]}},"/settings/sso-saml/validate":{"post":{"operationId":"SsoSamlController_validateSettings","parameters":[],"responses":{"200":{"description":"Validation completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateSsoSamlResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Validate current SSO/SAML configuration and update status.","tags":["SSO / SAML"]}},"/collect/dashboard":{"get":{"operationId":"CollectController_getDashboard","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectDashboardResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get Aequo Collect AR dashboard","tags":["Aequo Collect"]}},"/collect/sync":{"post":{"operationId":"CollectController_triggerSync","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerCollectSyncDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Trigger QuickBooks sync for customers and invoices","tags":["Aequo Collect"]}},"/collect/sync/status":{"get":{"operationId":"CollectController_getSyncStatus","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectSyncStatusResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get sync status","tags":["Aequo Collect"]}},"/collect/customers":{"get":{"operationId":"CollectController_listCustomers","parameters":[{"name":"creditGrade","required":false,"in":"query","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","schema":{"default":"name","type":"string"}},{"name":"sortOrder","required":false,"in":"query","schema":{"default":"asc","type":"string"}},{"name":"page","required":false,"in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"default":25,"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List customers with credit scores","tags":["Aequo Collect"]}},"/collect/customers/{id}":{"get":{"operationId":"CollectController_getCustomer","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get customer details with credit breakdown","tags":["Aequo Collect"]}},"/collect/invoices":{"get":{"operationId":"CollectController_listInvoices","parameters":[{"name":"customerId","required":false,"in":"query","schema":{"type":"string"}},{"name":"paymentStatus","required":false,"in":"query","schema":{"type":"string"}},{"name":"riskTier","required":false,"in":"query","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","schema":{"default":"dueDate","type":"string"}},{"name":"sortOrder","required":false,"in":"query","schema":{"default":"asc","type":"string"}},{"name":"page","required":false,"in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"default":25,"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List invoices with risk predictions","tags":["Aequo Collect"]}},"/collect/invoices/{id}":{"get":{"operationId":"CollectController_getInvoice","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get invoice details with predictions","tags":["Aequo Collect"]}},"/collect/predictions/score":{"post":{"operationId":"CollectController_scoreInvoices","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Run AI prediction scoring for all outstanding invoices","tags":["Aequo Collect"]}},"/collect/scoring/run":{"post":{"operationId":"CollectController_runCreditScoring","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Run credit scoring for all customers","tags":["Aequo Collect"]}},"/collect/customers/{id}/credit":{"get":{"operationId":"CollectController_getCreditBreakdown","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get detailed credit breakdown for a customer","tags":["Aequo Collect"]}},"/collect/chase-sequences":{"get":{"operationId":"CollectController_listChaseSequences","parameters":[{"name":"customerId","required":false,"in":"query","schema":{"type":"string"}},{"name":"invoiceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"page","required":false,"in":"query","schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","schema":{"default":25,"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List chase sequences","tags":["Aequo Collect"]},"post":{"operationId":"CollectController_createChaseSequence","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChaseSequenceDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Create a chase sequence for an invoice","tags":["Aequo Collect"]}},"/collect/chase-sequences/{id}":{"patch":{"operationId":"CollectController_updateChaseSequence","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChaseSequenceDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Turn auto-send on or off for a chase sequence","tags":["Aequo Collect"]}},"/collect/chase-sequences/{id}/pause":{"post":{"operationId":"CollectController_pauseChaseSequence","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Pause a chase sequence","tags":["Aequo Collect"]}},"/collect/chase-sequences/{id}/resume":{"post":{"operationId":"CollectController_resumeChaseSequence","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Resume a paused chase sequence","tags":["Aequo Collect"]}},"/collect/chase-sequences/{id}/cancel":{"post":{"operationId":"CollectController_cancelChaseSequence","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Cancel a chase sequence","tags":["Aequo Collect"]}},"/collect/chase-steps/{id}/generate":{"post":{"operationId":"CollectController_generateChaseStepContent","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Generate AI content for a chase step","tags":["Aequo Collect"]}},"/collect/chase-steps/{id}":{"put":{"operationId":"CollectController_updateChaseStep","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChaseStepDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update chase step content","tags":["Aequo Collect"]}},"/collect/chase-steps/{id}/send":{"post":{"operationId":"CollectController_sendChaseStep","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendChaseStepDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Send a chase step email","tags":["Aequo Collect"]}},"/collect/settings":{"get":{"operationId":"CollectController_getSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectSettingsResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Get Aequo Collect settings","tags":["Aequo Collect"]},"put":{"operationId":"CollectController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCollectSettingsDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update Aequo Collect settings","tags":["Aequo Collect"]}},"/forecast/settings":{"get":{"operationId":"ForecastController_getSettings","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get forecast settings","tags":["Forecast"]},"put":{"operationId":"ForecastController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateForecastSettingsDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update forecast settings","tags":["Forecast"]}},"/forecast/latest":{"get":{"operationId":"ForecastController_getLatestForecast","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get the latest forecast with summary metrics","tags":["Forecast"]}},"/forecast/generate":{"post":{"operationId":"ForecastController_generateForecast","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Generate a new forecast (on-demand)","tags":["Forecast"]}},"/forecast/history":{"get":{"operationId":"ForecastController_getForecastHistory","parameters":[{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get forecast history","tags":["Forecast"]}},"/forecast/snapshot/{id}":{"get":{"operationId":"ForecastController_getForecastById","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get a specific forecast snapshot","tags":["Forecast"]}},"/forecast/breakdown":{"get":{"operationId":"ForecastController_getCashFlowBreakdown","parameters":[{"name":"period","required":false,"in":"query","schema":{"enum":["weekly","monthly"],"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get cash flow breakdown by period (weekly/monthly)","tags":["Forecast"]}},"/forecast/recurring":{"get":{"operationId":"ForecastController_getRecurringTransactions","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List recurring transactions","tags":["Forecast"]},"post":{"operationId":"ForecastController_createRecurringTransaction","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecurringTransactionDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Create a recurring transaction","tags":["Forecast"]}},"/forecast/recurring/{id}":{"patch":{"operationId":"ForecastController_updateRecurringTransaction","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRecurringTransactionDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update a recurring transaction","tags":["Forecast"]},"delete":{"operationId":"ForecastController_deleteRecurringTransaction","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a recurring transaction","tags":["Forecast"]}},"/forecast/recurring/detect":{"post":{"operationId":"ForecastController_detectRecurringTransactions","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Auto-detect recurring transactions from QBO history","tags":["Forecast"]}},"/forecast/scenarios":{"get":{"operationId":"ForecastController_getScenarios","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List saved scenarios","tags":["Forecast"]},"post":{"operationId":"ForecastController_createScenario","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScenarioDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Create a new what-if scenario from a natural language query","tags":["Forecast"]}},"/forecast/scenarios/{id}":{"get":{"operationId":"ForecastController_getScenarioById","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get a specific scenario","tags":["Forecast"]},"delete":{"operationId":"ForecastController_deleteScenario","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a scenario","tags":["Forecast"]}},"/forecast/alerts":{"get":{"operationId":"ForecastController_getAlerts","parameters":[{"name":"includeRead","required":false,"in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get forecast alerts","tags":["Forecast"]}},"/forecast/alerts/{id}":{"patch":{"operationId":"ForecastController_updateAlert","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissAlertDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update alert (mark read/dismissed)","tags":["Forecast"]}},"/forecast/alerts/mark-all-read":{"post":{"operationId":"ForecastController_markAllAlertsRead","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Mark all alerts as read","tags":["Forecast"]}},"/audit/scans":{"post":{"operationId":"AuditController_triggerScan","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerAuditScanDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Trigger an audit scan for a QBO client","tags":["Audit"]},"get":{"operationId":"AuditController_listScans","parameters":[{"name":"connectionId","required":false,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List audit scans","tags":["Audit"]}},"/audit/scans/{scanId}":{"get":{"operationId":"AuditController_getScan","parameters":[{"name":"scanId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get audit scan details","tags":["Audit"]}},"/audit/findings":{"get":{"operationId":"AuditController_listFindings","parameters":[{"name":"connectionId","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","schema":{"type":"string"}},{"name":"severity","required":false,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortBy","required":false,"in":"query","schema":{"type":"string"}},{"name":"sortDir","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List audit findings with filters","tags":["Audit"]}},"/audit/findings/{findingId}":{"get":{"operationId":"AuditController_getFinding","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get audit finding details","tags":["Audit"]}},"/audit/findings/{findingId}/status":{"patch":{"operationId":"AuditController_updateFindingStatus","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFindingStatusDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update finding status","tags":["Audit"]}},"/audit/findings/{findingId}/feedback":{"post":{"operationId":"AuditController_submitFeedback","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFindingFeedbackDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Submit feedback on a finding","tags":["Audit"]}},"/audit/findings/{findingId}/evidence-bundle":{"post":{"operationId":"AuditController_generateEvidenceBundle","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Generate evidence bundle for a finding","tags":["Audit"]},"get":{"operationId":"AuditController_getEvidenceBundle","parameters":[{"name":"findingId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get evidence bundle for a finding","tags":["Audit"]}},"/audit/findings/bulk-status":{"post":{"operationId":"AuditController_bulkUpdateStatus","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateFindingStatusDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Bulk update finding statuses","tags":["Audit"]}},"/audit/dashboard":{"get":{"operationId":"AuditController_getDashboard","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get aggregated audit dashboard","tags":["Audit"]}},"/audit/dashboard/{connectionId}":{"get":{"operationId":"AuditController_getClientDashboard","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get per-client audit dashboard","tags":["Audit"]}},"/audit/health":{"get":{"operationId":"AuditController_listHealth","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List health scores for all QBO clients","tags":["Audit"]}},"/audit/health/{connectionId}":{"get":{"operationId":"AuditController_getHealth","parameters":[{"name":"connectionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get health score for a QBO client","tags":["Audit"]}},"/audit/reports":{"post":{"operationId":"AuditController_generateReport","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateAuditReportDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Generate an audit report","tags":["Audit"]},"get":{"operationId":"AuditController_listReports","parameters":[{"name":"connectionId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List audit reports","tags":["Audit"]}},"/audit/reports/{reportId}":{"get":{"operationId":"AuditController_getReport","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get audit report details","tags":["Audit"]}},"/audit/reports/{reportId}/download":{"get":{"operationId":"AuditController_downloadReport","parameters":[{"name":"reportId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Download audit report","tags":["Audit"]}},"/audit/settings":{"get":{"operationId":"AuditController_getSettings","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get audit settings","tags":["Audit"]},"put":{"operationId":"AuditController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAuditSettingsDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Update audit settings","tags":["Audit"]}},"/build/jobs":{"post":{"operationId":"JobController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]},"get":{"operationId":"JobController_findAll","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]}},"/build/jobs/commitments":{"get":{"operationId":"JobController_getCommitments","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]}},"/build/jobs/{id}":{"get":{"operationId":"JobController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]},"patch":{"operationId":"JobController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]}},"/build/jobs/{id}/phases":{"get":{"operationId":"JobController_findPhases","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"includeInactive","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]},"post":{"operationId":"JobController_createPhase","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobPhaseDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]}},"/build/jobs/{id}/phases/{phaseId}":{"patch":{"operationId":"JobController_updatePhase","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"phaseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateJobPhaseDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]}},"/build/jobs/{id}/invoice-context":{"get":{"operationId":"JobController_getInvoiceContext","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"vendorId","required":true,"in":"query","schema":{"type":"string"}},{"name":"costCodeId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Jobs"]}},"/build/schedule-of-values":{"post":{"operationId":"ScheduleOfValuesController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSovDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Schedule of Values"]}},"/build/schedule-of-values/job/{jobId}":{"get":{"operationId":"ScheduleOfValuesController_findByJob","parameters":[{"name":"jobId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Schedule of Values"]}},"/build/schedule-of-values/job/{jobId}/lines":{"post":{"operationId":"ScheduleOfValuesController_addLineItem","parameters":[{"name":"jobId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SovLineItemDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Schedule of Values"]},"patch":{"operationId":"ScheduleOfValuesController_replaceLineItems","parameters":[{"name":"jobId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceSovLinesDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Schedule of Values"]}},"/build/schedule-of-values/lines/{lineItemId}":{"patch":{"operationId":"ScheduleOfValuesController_updateLineItem","parameters":[{"name":"lineItemId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Schedule of Values"]}},"/build/pay-applications/{id}/aia-pdf/download":{"get":{"operationId":"PayApplicationController_downloadAiaPdf","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/pay-applications":{"post":{"operationId":"PayApplicationController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayApplicationDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]},"get":{"operationId":"PayApplicationController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/pay-applications/{id}":{"get":{"operationId":"PayApplicationController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/pay-applications/{id}/lines":{"patch":{"operationId":"PayApplicationController_updateLines","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePayAppLinesDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/pay-applications/{id}/submit":{"post":{"operationId":"PayApplicationController_submit","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/pay-applications/{id}/approve":{"post":{"operationId":"PayApplicationController_approve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/pay-applications/{id}/aia-pdf":{"post":{"operationId":"PayApplicationController_generateAiaPdf","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Pay Applications"]}},"/build/retention":{"post":{"operationId":"RetentionController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRetentionHoldDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]},"get":{"operationId":"RetentionController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/summary":{"get":{"operationId":"RetentionController_summary","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/{id}":{"get":{"operationId":"RetentionController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/{id}/request-release":{"patch":{"operationId":"RetentionController_requestRelease","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/{id}/release":{"patch":{"operationId":"RetentionController_release","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseRetentionDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/{id}/cancel-release-request":{"patch":{"operationId":"RetentionController_cancelReleaseRequest","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelReleaseRequestDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/{id}/releases":{"get":{"operationId":"RetentionController_findReleases","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/releases/{releaseId}/reverse":{"patch":{"operationId":"RetentionController_reverseRelease","parameters":[{"name":"releaseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseRetentionReleaseDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retention/releases/{releaseId}/mark-paid":{"patch":{"operationId":"RetentionController_markReleasePaid","parameters":[{"name":"releaseId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkRetentionReleasePaidDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retention"]}},"/build/retainage-schedules":{"get":{"operationId":"RetainageScheduleController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retainage Schedules"]},"post":{"operationId":"RetainageScheduleController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRetainageScheduleDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retainage Schedules"]}},"/build/retainage-schedules/{id}":{"delete":{"operationId":"RetainageScheduleController_delete","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Retainage Schedules"]}},"/build/subcontracts":{"post":{"operationId":"SubcontractController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubcontractDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontracts"]},"get":{"operationId":"SubcontractController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontracts"]}},"/build/subcontracts/{id}":{"get":{"operationId":"SubcontractController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontracts"]},"patch":{"operationId":"SubcontractController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSubcontractDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Subcontracts"]}},"/build/change-orders":{"post":{"operationId":"ChangeOrderController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChangeOrderDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Change Orders"]},"get":{"operationId":"ChangeOrderController_findAll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Change Orders"]}},"/build/change-orders/{id}":{"get":{"operationId":"ChangeOrderController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Change Orders"]},"patch":{"operationId":"ChangeOrderController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChangeOrderDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Change Orders"]}},"/build/change-orders/{id}/approve":{"post":{"operationId":"ChangeOrderController_approve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Change Orders"]}},"/build/change-orders/{id}/reject":{"post":{"operationId":"ChangeOrderController_reject","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Change Orders"]}},"/build/cost-codes":{"post":{"operationId":"CostCodeController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCostCodeDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]},"get":{"operationId":"CostCodeController_findAll","parameters":[{"name":"isActive","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]}},"/build/cost-codes/auto-assign":{"post":{"operationId":"CostCodeController_autoAssign","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoAssignCostCodeDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]}},"/build/cost-codes/dimensions/cost-types":{"get":{"operationId":"CostCodeController_findCostTypes","parameters":[{"name":"includeInactive","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]},"post":{"operationId":"CostCodeController_createCostType","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCostTypeDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]}},"/build/cost-codes/dimensions/cost-types/{id}":{"patch":{"operationId":"CostCodeController_updateCostType","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCostTypeDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]}},"/build/cost-codes/{id}":{"get":{"operationId":"CostCodeController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]},"patch":{"operationId":"CostCodeController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCostCodeDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]},"delete":{"operationId":"CostCodeController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Cost Codes"]}},"/build/insurance-certificates":{"post":{"operationId":"InsuranceCertificateController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInsuranceCertDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]},"get":{"operationId":"InsuranceCertificateController_findAll","parameters":[{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]}},"/build/insurance-certificates/expiring":{"get":{"operationId":"InsuranceCertificateController_findExpiring","parameters":[{"name":"days","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]}},"/build/insurance-certificates/requirements":{"post":{"operationId":"InsuranceCertificateController_createRequirement","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInsuranceRequirementDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]}},"/build/insurance-certificates/requirements/list":{"get":{"operationId":"InsuranceCertificateController_findRequirements","parameters":[{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}},{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]}},"/build/insurance-certificates/{id}":{"get":{"operationId":"InsuranceCertificateController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]},"patch":{"operationId":"InsuranceCertificateController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsuranceCertDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Insurance Certificates"]}},"/agent/runs":{"get":{"operationId":"AgentController_listRuns","parameters":[{"name":"agentName","required":true,"in":"query","schema":{"type":"string"}},{"name":"limit","required":true,"in":"query","schema":{"type":"string"}},{"name":"offset","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List agent runs for the tenant","tags":["Agent"]}},"/agent/runs/{id}":{"get":{"operationId":"AgentController_getRun","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get agent run detail","tags":["Agent"]}},"/settings/autonomous-agent":{"get":{"operationId":"AutonomousAgentController_getSettings","parameters":[],"responses":{"200":{"description":"Autonomous agent settings retrieved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomousAgentSettingsDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get autonomous agent settings for the tenant.","tags":["Autonomous Agent"]},"put":{"operationId":"AutonomousAgentController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutonomousAgentSettingsDto"}}}},"responses":{"200":{"description":"Autonomous agent settings updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomousAgentSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Update autonomous agent settings.","tags":["Autonomous Agent"]}},"/settings/autonomous-agent/runs":{"get":{"operationId":"AutonomousAgentController_listRuns","parameters":[{"name":"limit","required":false,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":"Autonomous run history fetched successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomousAgentRunListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List recent autonomous agent runs for observability and audit.","tags":["Autonomous Agent"]}},"/settings/autonomous-agent/run":{"post":{"operationId":"AutonomousAgentController_runNow","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAutonomousAgentDto"}}}},"responses":{"200":{"description":"Autonomous agent run completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomousAgentRunSummaryDto"}}}}},"security":[{"bearer":[]}],"summary":"Run the autonomous agent immediately.","tags":["Autonomous Agent"]}},"/settings/autonomous-agent/rollback/{exceptionId}":{"post":{"operationId":"AutonomousAgentController_rollbackResolution","parameters":[{"name":"exceptionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Rollback an auto-resolved exception (Scale+)","tags":["Autonomous Agent"]}},"/settings/autonomous-agent/feedback/{exceptionId}":{"post":{"operationId":"AutonomousAgentController_submitFeedback","parameters":[{"name":"exceptionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Submit feedback on agent auto-resolution","tags":["Autonomous Agent"]}},"/build/agents/invoke":{"post":{"operationId":"BuildAgentController_invoke","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvokeAgentDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - AI Agents"]}},"/build/agents":{"get":{"operationId":"BuildAgentController_listAgents","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - AI Agents"]}},"/demo/provision":{"post":{"description":"Creates a demo tenant for the authenticated user (or returns existing one). Seeds comprehensive AP data for exploration.","operationId":"DemoController_provisionDemo","parameters":[],"responses":{"200":{"description":"Demo tenant provisioned successfully."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Provision a demo tenant with pre-seeded data","tags":["Demo"]}},"/settings/legal-entities":{"get":{"operationId":"LegalEntityController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalEntityListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List legal entities for the current tenant.","tags":["Legal Entity"]},"post":{"operationId":"LegalEntityController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertLegalEntityDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalEntityDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a legal entity.","tags":["Legal Entity"]}},"/settings/legal-entities/{id}":{"put":{"operationId":"LegalEntityController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertLegalEntityDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalEntityDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a legal entity.","tags":["Legal Entity"]}},"/branches":{"get":{"operationId":"BranchController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List branches (locations) for the current tenant.","tags":["Branch"]},"post":{"operationId":"BranchController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBranchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a branch.","tags":["Branch"]}},"/branches/spend-summary":{"get":{"operationId":"BranchController_spendSummary","parameters":[{"name":"branchId","required":false,"in":"query","schema":{"type":"string"}},{"name":"from","required":false,"in":"query","schema":{"type":"string"}},{"name":"to","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchSpendSummaryDto"}}}}},"security":[{"bearer":[]}],"summary":"Invoice spend per branch for a period (default month to date), net of credit memos.","tags":["Branch"]}},"/branches/{id}":{"put":{"operationId":"BranchController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBranchDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BranchDto"}}}}},"security":[{"bearer":[]}],"summary":"Update a branch.","tags":["Branch"]}},"/profile":{"get":{"operationId":"ProfileController_getProfile","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponseDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get the current user profile.","tags":["Profile"]},"put":{"operationId":"ProfileController_updateProfile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponseDto"}}}},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Update the current user profile.","tags":["Profile"]}},"/settings/personalization":{"get":{"operationId":"PersonalizationController_getSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalizationSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Get user personalization settings.","tags":["Personalization"]},"put":{"operationId":"PersonalizationController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePersonalizationSettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalizationSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Update user personalization settings.","tags":["Personalization"]}},"/notification-preferences":{"get":{"operationId":"NotificationPreferencesController_getPreferences","parameters":[],"responses":{"200":{"description":"Successfully retrieved notification preferences."},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Get tenant's email notification preferences.","tags":["Notification Preferences"]},"put":{"operationId":"NotificationPreferencesController_updatePreferences","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationPreferencesDto"}}}},"responses":{"200":{"description":"Successfully updated notification preferences."},"401":{"description":"Unauthorized."},"500":{"description":"Internal server error."}},"security":[{"bearer":[]}],"summary":"Update tenant's email notification preferences.","tags":["Notification Preferences"]}},"/settings/notifications":{"get":{"operationId":"SettingsNotificationPreferencesController_getSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Get tenant notification matrix settings.","tags":["Notification Settings"]},"patch":{"operationId":"SettingsNotificationPreferencesController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationSettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Update tenant notification matrix settings.","tags":["Notification Settings"]}},"/settings/notifications/slack-destination":{"get":{"operationId":"SettingsNotificationSlackController_getSlackDestination","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSlackDestinationDto"}}}}},"security":[{"bearer":[]}],"summary":"Get tenant Slack notification destination.","tags":["Notification Settings"]},"patch":{"operationId":"SettingsNotificationSlackController_updateSlackDestination","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationSlackDestinationDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSlackDestinationDto"}}}}},"security":[{"bearer":[]}],"summary":"Update tenant Slack notification destination.","tags":["Notification Settings"]}},"/settings/profile-notifications":{"get":{"operationId":"ProfileNotificationPreferencesController_getPreferences","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileNotificationPreferencesDto"}}}}},"security":[{"bearer":[]}],"summary":"Get user profile notification preferences.","tags":["Profile Notification Preferences"]},"put":{"operationId":"ProfileNotificationPreferencesController_updatePreferences","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileNotificationPreferencesDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileNotificationPreferencesDto"}}}}},"security":[{"bearer":[]}],"summary":"Update user profile notification preferences.","tags":["Profile Notification Preferences"]}},"/settings/profile-notifications/push-subscriptions":{"get":{"operationId":"ProfileNotificationPreferencesController_listPushSubscriptions","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionListDto"}}}}},"security":[{"bearer":[]}],"summary":"List active web push subscriptions for the user.","tags":["Profile Notification Preferences"]},"post":{"operationId":"ProfileNotificationPreferencesController_createPushSubscription","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePushSubscriptionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionDto"}}}}},"security":[{"bearer":[]}],"summary":"Create or refresh an active web push subscription for the user.","tags":["Profile Notification Preferences"]}},"/settings/profile-notifications/push-subscriptions/{id}":{"delete":{"operationId":"ProfileNotificationPreferencesController_deletePushSubscription","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete a web push subscription for the user.","tags":["Profile Notification Preferences"]}},"/notifications":{"get":{"operationId":"NotificationCenterController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationCenterListDto"}}}}},"security":[{"bearer":[]}],"summary":"List persisted notification-center items.","tags":["Notification Center"]}},"/notifications/read-all":{"post":{"operationId":"NotificationCenterController_markAllRead","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationCenterListDto"}}}}},"security":[{"bearer":[]}],"summary":"Mark all visible notifications as read.","tags":["Notification Center"]}},"/notifications/{id}/read":{"post":{"operationId":"NotificationCenterController_markRead","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationCenterItemDto"}}}}},"security":[{"bearer":[]}],"summary":"Mark one notification as read.","tags":["Notification Center"]}},"/notifications/{id}/dismiss":{"post":{"operationId":"NotificationCenterController_dismiss","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Dismiss one notification.","tags":["Notification Center"]}},"/api-keys":{"get":{"operationId":"ApiKeyController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"List API keys for the current tenant.","tags":["API Keys"]},"post":{"operationId":"ApiKeyController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a new tenant API key.","tags":["API Keys"]}},"/api-keys/{id}":{"delete":{"operationId":"ApiKeyController_revoke","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Revoke a tenant API key.","tags":["API Keys"]}},"/settings/sla":{"get":{"operationId":"SlaSettingsController_getSettings","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlaSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Get tenant SLA and escalation settings.","tags":["SLA Settings"]},"put":{"operationId":"SlaSettingsController_updateSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSlaSettingsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlaSettingsDto"}}}}},"security":[{"bearer":[]}],"summary":"Update tenant SLA and escalation settings.","tags":["SLA Settings"]}},"/tax-compliance/vendors":{"get":{"operationId":"TaxComplianceController_listVendors","parameters":[{"name":"year","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/vendors/{supplierId}":{"patch":{"operationId":"TaxComplianceController_updateVendorTax","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVendorTaxDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/vendors/{supplierId}/tax-id":{"get":{"operationId":"TaxComplianceController_revealVendorTaxId","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/vendors/{supplierId}/request-w9":{"post":{"operationId":"TaxComplianceController_requestW9","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/1099s/summary":{"get":{"operationId":"TaxComplianceController_get1099Summary","parameters":[{"name":"taxYear","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/1099s":{"get":{"operationId":"TaxComplianceController_list1099Forms","parameters":[{"name":"taxYear","required":true,"in":"query","schema":{"type":"string"}},{"name":"status","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/1099s/generate":{"post":{"operationId":"TaxComplianceController_generate1099s","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generate1099sDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/tax-compliance/1099s/{id}":{"get":{"operationId":"TaxComplianceController_get1099Form","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]},"patch":{"operationId":"TaxComplianceController_update1099Status","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Tax Compliance"]}},"/bulk-import/upload":{"post":{"operationId":"BulkImportController_upload","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"importType":{"type":"string","enum":["INVOICE","PURCHASE_ORDER"],"description":"CSV/Excel record type. Defaults to INVOICE."},"columnMapping":{"type":"object","description":"Optional column mapping JSON"}}}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Upload a CSV or Excel file to create a bulk import batch","tags":["Bulk Import"]}},"/bulk-import/batches":{"get":{"operationId":"BulkImportController_findAll","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List bulk import batches","tags":["Bulk Import"]}},"/bulk-import/batches/{id}":{"get":{"operationId":"BulkImportController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get batch details with item summary","tags":["Bulk Import"]},"delete":{"operationId":"BulkImportController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete an unprocessed batch","tags":["Bulk Import"]}},"/bulk-import/batches/{id}/items":{"get":{"operationId":"BulkImportController_findItems","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"enum":["PENDING","SUCCESS","FAILED","SKIPPED"],"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List items in a batch","tags":["Bulk Import"]}},"/bulk-import/batches/{id}/process":{"post":{"operationId":"BulkImportController_process","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Process a bulk import batch","tags":["Bulk Import"]}},"/erp-connector/procore/embedded/handoff":{"post":{"operationId":"ProcoreEmbeddedController_createHandoff","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProcoreEmbeddedHandoffDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreEmbeddedHandoffResponse"}}}}},"security":[{"bearer":[]}],"summary":"Mint a single-use handoff code for the Procore embedded panel (called from the first-party sign-in popup)","tags":["ERP Connector"]}},"/erp-connector/procore/embedded/session":{"post":{"operationId":"ProcoreEmbeddedController_exchange","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeProcoreEmbeddedHandoffDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreEmbeddedSessionResponse"}}}}},"summary":"Redeem a handoff code (once) for a short-lived read-only embedded session token","tags":["ERP Connector"]}},"/erp-connector/procore/embedded/overview":{"get":{"operationId":"ProcoreEmbeddedController_getOverview","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreEmbeddedOverviewResponse"}}}}},"security":[{"bearer":[]}],"summary":"Company-level embedded view: whether this Procore company is connected to the caller tenant, and its synced projects","tags":["ERP Connector"]}},"/erp-connector/procore/embedded/projects/{procoreProjectId}/summary":{"get":{"operationId":"ProcoreEmbeddedController_getProjectSummary","parameters":[{"name":"procoreProjectId","required":true,"in":"path","description":"Procore project id","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcoreEmbeddedProjectSummaryResponse"}}}}},"security":[{"bearer":[]}],"summary":"Project panel: invoices awaiting approval, retention held, lien-waiver status and subcontractor compliance for the Build job linked to this Procore project","tags":["ERP Connector"]}},"/build/prevailing-wage/certified-payroll/{id}/generate-wh347":{"post":{"operationId":"PrevailingWageController_generateWh347","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/prevailing-wage/certified-payroll/{id}/wh347/download":{"get":{"operationId":"PrevailingWageController_downloadWh347","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/prevailing-wage/requirements":{"get":{"operationId":"PrevailingWageController_getRequirement","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]},"post":{"operationId":"PrevailingWageController_upsertRequirement","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWageRequirementDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/prevailing-wage/certified-payroll":{"get":{"operationId":"PrevailingWageController_listCertifiedPayroll","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}},{"name":"supplierId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]},"post":{"operationId":"PrevailingWageController_createCertifiedPayroll","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCertifiedPayrollDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/prevailing-wage/certified-payroll/{id}/submit":{"patch":{"operationId":"PrevailingWageController_submitPayroll","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/prevailing-wage/certified-payroll/{id}/verify":{"patch":{"operationId":"PrevailingWageController_verifyPayroll","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/prevailing-wage/compliance-status":{"get":{"operationId":"PrevailingWageController_getComplianceStatus","parameters":[{"name":"jobId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Prevailing Wage"]}},"/build/vendor-import/upload":{"post":{"operationId":"VendorImportController_upload","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"columnMapping":{"type":"object","description":"Optional column mapping JSON"}}}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"summary":"Upload a CSV file to create a vendor import batch","tags":["Vendor Import"]}},"/build/vendor-import/batches":{"get":{"operationId":"VendorImportController_findAll","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"List vendor import batches","tags":["Vendor Import"]}},"/build/vendor-import/batches/{id}":{"get":{"operationId":"VendorImportController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Get vendor import batch detail with item statuses","tags":["Vendor Import"]},"delete":{"operationId":"VendorImportController_remove","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"204":{"description":""}},"security":[{"bearer":[]}],"summary":"Delete an unprocessed vendor import batch","tags":["Vendor Import"]}},"/build/vendor-import/batches/{id}/process":{"post":{"operationId":"VendorImportController_process","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"summary":"Process a vendor import batch","tags":["Vendor Import"]}},"/build/dashboard/analytics":{"get":{"operationId":"BuildDashboardController_getAnalytics","parameters":[],"responses":{"200":{"description":"Analytics data retrieved successfully."},"401":{"description":"Unauthorized"}},"security":[{"bearer":[]}],"summary":"Get build dashboard analytics (profitability, WIP aging, retainage)","tags":["Build - Dashboard"]}},"/build/vendors":{"get":{"operationId":"BuildVendorController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Vendors"]},"post":{"operationId":"BuildVendorController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildVendorDto"}}}},"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Vendors"]}},"/build/vendors/{id}":{"get":{"operationId":"BuildVendorController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Vendors"]}},"/build/invoices":{"get":{"operationId":"BuildInvoiceController_list","parameters":[{"name":"status","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/invoices/upload":{"post":{"operationId":"BuildInvoiceController_upload","parameters":[],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/invoices/{id}":{"get":{"operationId":"BuildInvoiceController_findOne","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]},"patch":{"operationId":"BuildInvoiceController_update","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBuildInvoiceDto"}}}},"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/invoices/{id}/preview":{"get":{"operationId":"BuildInvoiceController_preview","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/invoices/{id}/approve":{"post":{"operationId":"BuildInvoiceController_approve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/invoices/{id}/reject":{"post":{"operationId":"BuildInvoiceController_reject","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/invoices/{id}/extract":{"post":{"operationId":"BuildInvoiceController_extract","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Invoices"]}},"/build/exceptions":{"get":{"operationId":"BuildExceptionController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Exceptions"]}},"/build/exceptions/{id}/investigate":{"post":{"operationId":"BuildExceptionController_investigate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Exceptions"]}},"/build/exceptions/{id}/resolve":{"post":{"operationId":"BuildExceptionController_resolve","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Exceptions"]}},"/build/exceptions/{id}/escalate":{"post":{"operationId":"BuildExceptionController_escalate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Exceptions"]}},"/build/previews/{source}/{id}":{"get":{"operationId":"BuildPreviewController_resolve","parameters":[{"name":"source","required":true,"in":"path","schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Previews"]}},"/build/work-queue":{"get":{"operationId":"BuildWorkQueueController_list","parameters":[],"responses":{"200":{"description":""}},"security":[{"bearer":[]}],"tags":["Build - Work Queue"]}},"/payments/capabilities":{"get":{"description":"Returns which payment rails (ACH, Wire, Virtual Card, Check) are available based on Stripe product configuration.","operationId":"PaymentNetworkController_getCapabilities","parameters":[],"responses":{"200":{"description":"Payment capabilities retrieved."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get payment capabilities for this tenant.","tags":["Payment Network"]}},"/payments/initiate":{"post":{"description":"Creates a PaymentExecution and dispatches to the appropriate rail (ACH, Wire, Virtual Card, or Check).","operationId":"PaymentNetworkController_initiatePayment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiatePaymentDto"}}}},"responses":{"200":{"description":"Payment initiated successfully."},"400":{"description":"Invalid request or rail not available."},"401":{"description":"Unauthorized."},"403":{"description":"Payments not enabled for this tenant."},"409":{"description":"Payment already in progress for this document."}},"security":[{"bearer":[]}],"summary":"Initiate a payment for an invoice.","tags":["Payment Network"]}},"/payments":{"get":{"operationId":"PaymentNetworkController_listPayments","parameters":[{"name":"documentId","required":false,"in":"query","description":"Filter by document ID","schema":{"type":"string"}},{"name":"supplierId","required":false,"in":"query","description":"Filter by supplier ID","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by payment status","schema":{"type":"string","enum":["INITIATED","PROCESSING","SETTLED","FAILED","CANCELLED","REFUNDED"]}},{"name":"method","required":false,"in":"query","description":"Filter by payment method","schema":{"type":"string","enum":["ACH","WIRE","VIRTUAL_CARD","CHECK"]}},{"name":"page","required":false,"in":"query","description":"Page number","schema":{"default":1,"type":"number"}},{"name":"limit","required":false,"in":"query","description":"Items per page","schema":{"default":25,"type":"number"}}],"responses":{"200":{"description":"Payments list retrieved."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"List payments with filters.","tags":["Payment Network"]}},"/payments/summary":{"get":{"operationId":"PaymentNetworkController_getPaymentSummary","parameters":[],"responses":{"200":{"description":"Payment summary retrieved."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get payment summary statistics for dashboard cards.","tags":["Payment Network"]}},"/payments/config/current":{"get":{"operationId":"PaymentNetworkController_getPaymentConfig","parameters":[],"responses":{"200":{"description":"Payment config retrieved."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Get tenant payment configuration.","tags":["Payment Network"]}},"/payments/config":{"patch":{"operationId":"PaymentNetworkController_updatePaymentConfig","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentConfigDto"}}}},"responses":{"200":{"description":"Payment config updated."},"401":{"description":"Unauthorized."}},"security":[{"bearer":[]}],"summary":"Update tenant payment configuration.","tags":["Payment Network"]}},"/payments/{id}":{"get":{"operationId":"PaymentNetworkController_getPayment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Payment retrieved."},"401":{"description":"Unauthorized."},"404":{"description":"Payment not found."}},"security":[{"bearer":[]}],"summary":"Get a single payment detail.","tags":["Payment Network"]}},"/payments/{id}/cancel":{"post":{"operationId":"PaymentNetworkController_cancelPayment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Payment cancelled."},"400":{"description":"Payment cannot be cancelled."},"401":{"description":"Unauthorized."},"404":{"description":"Payment not found."}},"security":[{"bearer":[]}],"summary":"Cancel a payment.","tags":["Payment Network"]}},"/payments/webhook":{"post":{"description":"No auth guard — uses Stripe webhook signature verification instead.","operationId":"PaymentNetworkController_handleWebhook","parameters":[{"name":"stripe-signature","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook processed."},"400":{"description":"Invalid webhook signature."}},"summary":"Handle Stripe payment webhook events.","tags":["Payment Network"]}},"/vendor-payment-methods/{supplierId}":{"get":{"operationId":"VendorPaymentMethodController_getVendorPaymentMethods","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Payment methods retrieved."},"401":{"description":"Unauthorized."},"404":{"description":"Supplier not found."}},"security":[{"bearer":[]}],"summary":"List payment methods for a vendor.","tags":["Vendor Payment Methods"]},"post":{"operationId":"VendorPaymentMethodController_addPaymentMethod","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPaymentMethodDto"}}}},"responses":{"200":{"description":"Payment method added."},"400":{"description":"Invalid payment method details."},"401":{"description":"Unauthorized."},"404":{"description":"Supplier not found."}},"security":[{"bearer":[]}],"summary":"Add a payment method for a vendor.","tags":["Vendor Payment Methods"]}},"/vendor-payment-methods/{supplierId}/financial-connection":{"post":{"description":"Returns a client secret for the frontend to use with the Stripe Financial Connections SDK.","operationId":"VendorPaymentMethodController_initiateFinancialConnection","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Financial Connection session created."},"401":{"description":"Unauthorized."},"403":{"description":"Financial Connections not enabled for this tenant."},"404":{"description":"Supplier not found."}},"security":[{"bearer":[]}],"summary":"Start Stripe Financial Connections flow for a vendor.","tags":["Vendor Payment Methods"]}},"/vendor-payment-methods/{supplierId}/financial-connection/complete":{"post":{"description":"Call after the user has authorized the bank account connection on the frontend.","operationId":"VendorPaymentMethodController_completeFinancialConnection","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteFinancialConnectionDto"}}}},"responses":{"200":{"description":"Financial Connection completed."},"401":{"description":"Unauthorized."},"404":{"description":"Supplier not found."}},"security":[{"bearer":[]}],"summary":"Complete a Financial Connections flow.","tags":["Vendor Payment Methods"]}},"/vendor-payment-methods/{id}":{"delete":{"operationId":"VendorPaymentMethodController_removePaymentMethod","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Payment method removed."},"401":{"description":"Unauthorized."},"404":{"description":"Payment method not found."}},"security":[{"bearer":[]}],"summary":"Remove a payment method.","tags":["Vendor Payment Methods"]}},"/vendor-payment-methods/{supplierId}/set-default":{"patch":{"operationId":"VendorPaymentMethodController_setDefaultMethod","parameters":[{"name":"supplierId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDefaultMethodDto"}}}},"responses":{"200":{"description":"Default payment method updated."},"401":{"description":"Unauthorized."},"404":{"description":"Supplier or payment method not found."}},"security":[{"bearer":[]}],"summary":"Set the default payment method for a vendor.","tags":["Vendor Payment Methods"]}},"/command-search":{"get":{"operationId":"CommandSearchController_search","parameters":[{"name":"q","required":false,"in":"query","description":"Search query for records and actions.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum results per group.","schema":{"default":5,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandSearchResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Search Aequo actions and tenant records for global command search","tags":["Command Search"]}},"/collaboration-comments":{"get":{"operationId":"CollaborationCommentController_list","parameters":[{"name":"contextType","required":true,"in":"query","schema":{"type":"string","enum":["document","payments","reports"]}},{"name":"contextId","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CollaborationCommentResponseDto"}}}}}},"security":[{"bearer":[]}],"summary":"List collaboration comments for a record context","tags":["Collaboration Comments"]},"post":{"operationId":"CollaborationCommentController_create","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCollaborationCommentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollaborationCommentResponseDto"}}}}},"security":[{"bearer":[]}],"summary":"Create a collaboration comment","tags":["Collaboration Comments"]}},"/health":{"get":{"operationId":"HealthController_check","parameters":[],"responses":{"200":{"description":"All health checks passed\n\nThe Health Check is successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"info":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"error":{"type":"object","example":{},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"details":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true}}}}}}},"503":{"description":"One or more health checks failed\n\nThe Health Check is not successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"info":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"error":{"type":"object","example":{"redis":{"status":"down","message":"Could not connect"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"details":{"type":"object","example":{"database":{"status":"up"},"redis":{"status":"down","message":"Could not connect"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true}}}}}}}},"summary":"Full health check including database","tags":["Health"]}},"/health/live":{"get":{"operationId":"HealthController_liveness","parameters":[],"responses":{"200":{"description":"Application is alive"}},"summary":"Liveness probe - checks if the application is running","tags":["Health"]}},"/health/ready":{"get":{"operationId":"HealthController_readiness","parameters":[],"responses":{"200":{"description":"Application is ready\n\nThe Health Check is successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"info":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"error":{"type":"object","example":{},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"details":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true}}}}}}},"503":{"description":"Application is not ready\n\nThe Health Check is not successful","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"info":{"type":"object","example":{"database":{"status":"up"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"error":{"type":"object","example":{"redis":{"status":"down","message":"Could not connect"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true},"nullable":true},"details":{"type":"object","example":{"database":{"status":"up"},"redis":{"status":"down","message":"Could not connect"}},"additionalProperties":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}},"additionalProperties":true}}}}}}}},"summary":"Readiness probe - checks if the application is ready to accept traffic","tags":["Health"]}},"/aws-marketplace/register":{"get":{"operationId":"AwsMarketplaceController_register","parameters":[{"name":"token","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["AwsMarketplace"]}},"/aws-marketplace/webhook/sns":{"post":{"operationId":"AwsMarketplaceController_handleSnsNotification","parameters":[{"name":"x-amz-sns-message-type","required":true,"in":"header","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["AwsMarketplace"]}}},"info":{"title":"Aequo API","description":"API documentation for the Aequo platform","version":"1.0","contact":{}},"tags":[{"name":"Documents","description":""},{"name":"Exceptions","description":""}],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"TolerancesDTOClass":{"type":"object","properties":{"pricePct":{"type":"number"},"qtyUnits":{"type":"number"},"taxPct":{"type":"number"},"ignoreTaxLines":{"type":"boolean"}}},"SupplierCreateRequest":{"type":"object","properties":{"name":{"type":"string","description":"Supplier name"},"email":{"type":"string","description":"General supplier email address"},"contactEmail":{"type":"string","description":"Primary contact email for the supplier"},"contactPhone":{"type":"string","description":"Primary contact phone for the supplier"},"primaryContactName":{"type":"string","description":"Name of the primary contact person at the supplier"},"countryCode":{"type":"string","description":"Supplier country code (ISO 3166-1 alpha-2)","example":"US"},"preferredLanguage":{"type":"string","description":"Supplier preferred language code (ISO 639-1)","example":"en"},"tolerances":{"description":"Supplier-specific tolerance overrides","nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/TolerancesDTOClass"}]}},"required":["name","email"]},"SupplierResponse":{"type":"object","properties":{"id":{"type":"string","description":"Supplier ID","format":"uuid"},"name":{"type":"string","description":"Supplier name"},"email":{"type":"string","description":"General supplier email address"},"contactEmail":{"type":"string","description":"Primary contact email for the supplier"},"contactPhone":{"type":"string","description":"Primary contact phone for the supplier"},"primaryContactName":{"type":"string","description":"Name of the primary contact person at the supplier"},"tolerances":{"type":"object","description":"Tolerances"},"countryCode":{"type":"string","description":"Supplier country code (ISO 3166-1 alpha-2)","example":"DE"},"preferredLanguage":{"type":"string","description":"Supplier preferred language code (ISO 639-1)","example":"de"},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"updatedAt":{"type":"string","description":"Last update timestamp","format":"date-time"},"deletedAt":{"type":"string","description":"Deleted at","format":"date-time","nullable":true}},"required":["id","name","email","tolerances","createdAt","updatedAt"]},"SupplierListResponse":{"type":"object","properties":{"data":{"description":"List of suppliers","type":"array","items":{"$ref":"#/components/schemas/SupplierResponse"}},"nextCursor":{"type":"string","description":"Pagination cursor for next page","nullable":true}},"required":["data"]},"SupplierUpdateRequest":{"type":"object","properties":{"name":{"type":"string","description":"Supplier name"},"email":{"type":"string","description":"General supplier email address"},"contactEmail":{"type":"string","description":"Primary contact email for the supplier"},"contactPhone":{"type":"string","description":"Primary contact phone for the supplier"},"primaryContactName":{"type":"string","description":"Name of the primary contact person at the supplier"},"countryCode":{"type":"string","description":"Supplier country code (ISO 3166-1 alpha-2)","example":"US"},"preferredLanguage":{"type":"string","description":"Supplier preferred language code (ISO 639-1)","example":"en"},"tolerances":{"description":"Supplier-specific tolerance overrides","nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/TolerancesDTOClass"}]}}},"SupplierEmailTestResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the test email was accepted for delivery"},"message":{"type":"string","description":"User-facing success message describing the delivery result"},"error":{"type":"string","description":"User-facing failure message returned by the email provider"},"smtpStatus":{"type":"string","description":"Provider delivery status for the test email request","enum":["SENT","QUEUED","FAILED"]},"messageId":{"type":"string","description":"Provider message ID when available"}},"required":["success"]},"CsvColumnSelectionDto":{"type":"object","properties":{"columnName":{"type":"string","description":"CSV column header label"},"index":{"type":"number","description":"Zero-based index of the CSV column"}},"required":["columnName","index"]},"SupplierCsvMappingDto":{"type":"object","properties":{"headerRow":{"description":"Ordered header row used to compute the mapping hash","type":"array","items":{"type":"string"}},"sku":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"description":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"quantity":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"unitPrice":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"headerHash":{"type":"string","description":"SHA1 of the normalized header row"}},"required":["headerRow","sku","description","quantity","headerHash"]},"SupplierCsvMappingResponse":{"type":"object","properties":{"supplierId":{"type":"string","description":"Supplier ID","format":"uuid"},"mapping":{"description":"Stored CSV mapping for the supplier, if one exists","nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/SupplierCsvMappingDto"}]}},"required":["supplierId"]},"UpsertSupplierCsvMappingRequest":{"type":"object","properties":{"headerRow":{"description":"Ordered header row used to compute the mapping hash","type":"array","items":{"type":"string"}},"sku":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"description":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"quantity":{"$ref":"#/components/schemas/CsvColumnSelectionDto"},"unitPrice":{"$ref":"#/components/schemas/CsvColumnSelectionDto"}},"required":["headerRow","sku","description","quantity"]},"DocumentReprocessResponse":{"type":"object","properties":{"id":{"type":"string","description":"Document ID","format":"uuid"},"status":{"type":"string","description":"Current document status","enum":["PROCESSING","READY","FAILED","ARCHIVED","REVIEW_REQUIRED","DUPLICATE"]},"queuedAt":{"type":"string","description":"When reprocessing was queued","format":"date-time"}},"required":["id","status","queuedAt"]},"DocumentMatchReadinessIssueResponse":{"type":"object","properties":{"code":{"type":"string","description":"Stable issue code describing the matching readiness issue."},"severity":{"type":"string","description":"Severity of the issue.","enum":["info","warning","error"]},"message":{"type":"string","description":"User-facing explanation of the issue or recommendation."}},"required":["code","severity","message"]},"DocumentMatchReadinessResponse":{"type":"object","properties":{"status":{"type":"string","description":"Overall readiness state for invoice-to-PO matching.","enum":["MATCHED","READY","ACTION_REQUIRED","BLOCKED"]},"summary":{"type":"string","description":"Short summary of what Aequo knows about the matchability of this invoice."},"issues":{"description":"Structured issues and recommendations derived from cross-checking tenant data.","type":"array","items":{"$ref":"#/components/schemas/DocumentMatchReadinessIssueResponse"}},"nextActions":{"description":"Ordered next steps for the operator.","type":"array","items":{"type":"string"}},"matchId":{"type":"string","description":"Linked match ID when this document is already attached to a match."},"matchStatus":{"type":"string","description":"Current linked match status when this document is already attached to a match."},"suggestedPoNumber":{"type":"string","description":"Suggested PO number when Aequo finds a strong supplier-level candidate."},"suggestedPoSource":{"type":"string","description":"Source of the suggested PO recommendation.","enum":["QUICKBOOKS_LINK","SUPPLIER_HEURISTIC"]},"suggestedPoReason":{"type":"string","description":"Short explanation of why Aequo suggested this purchase order."},"candidatePurchaseOrderCount":{"type":"number","description":"Count of candidate purchase orders evaluated for this invoice."}},"required":["status","summary","issues","nextActions"]},"DocumentInsuranceMetadataResponse":{"type":"object","properties":{"id":{"type":"string","description":"Insurance metadata ID","format":"uuid"},"claimId":{"type":"string","description":"Insurance claim ID"},"policyId":{"type":"string","description":"Insurance policy ID"},"treatyId":{"type":"string","description":"Insurance treaty ID"},"extractionConfidence":{"type":"number","description":"Identifier extraction confidence score from OCR parsing"},"extractionMethod":{"type":"string","description":"Identifier extraction method used during OCR parsing"},"extractionTimeMs":{"type":"number","description":"Identifier extraction runtime in milliseconds"},"claimVerificationStatus":{"type":"string","description":"Claim verification status","enum":["UNVERIFIED","VERIFIED","UNKNOWN_CLAIM_ID","ERROR"]},"claimVerificationMessage":{"type":"string","description":"Claim verification message"},"claimVerificationProvider":{"type":"string","description":"Claims provider used for verification"},"claimLifecycleStatus":{"type":"string","description":"Claim lifecycle status returned by the core system"},"claimVerifiedAt":{"type":"string","description":"When the claim was last verified successfully","format":"date-time"},"claimLastCheckedAt":{"type":"string","description":"When the claim was last checked against the core system","format":"date-time"},"lob":{"type":"string","description":"Insurance line of business"},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"updatedAt":{"type":"string","description":"Last update timestamp","format":"date-time"}},"required":["id","createdAt","updatedAt"]},"DocumentResponse":{"type":"object","properties":{"id":{"type":"string","description":"Document ID","format":"uuid"},"supplierId":{"type":"string","description":"Associated supplier ID","format":"uuid"},"supplierName":{"type":"string","description":"Supplier name captured for the document"},"type":{"type":"string","description":"Document type","enum":["PO","INV","DN","REINSURANCE_PREMIUM_STATEMENT","BROKER_COMMISSION_STATEMENT"]},"poNumber":{"type":"string","description":"Purchase order number"},"invoiceNumber":{"type":"string","description":"Invoice number"},"deliveryNoteNumber":{"type":"string","description":"Delivery note number"},"documentDate":{"type":"string","description":"Document date","format":"date-time"},"status":{"type":"string","description":"Document status","enum":["PROCESSING","READY","FAILED","ARCHIVED","REVIEW_REQUIRED","DUPLICATE"]},"source":{"type":"string","description":"How the document entered Aequo","enum":["UPLOAD","EMAIL","SFTP","API"]},"approvalStatus":{"type":"string","description":"Document approval status","enum":["NOT_REQUIRED","NOT_SUBMITTED","PENDING","AWAITING_ESCALATION","APPROVED","REJECTED"]},"codingStatus":{"type":"string","description":"Document coding status","enum":["NOT_REQUIRED","UNCODED","PARTIAL","CODED"]},"needsReview":{"type":"boolean","description":"Needs review"},"needsReviewReason":{"type":"string","description":"Reason for needing review"},"matchReadiness":{"description":"Structured readiness analysis for invoice-to-PO matching and next-step guidance.","allOf":[{"$ref":"#/components/schemas/DocumentMatchReadinessResponse"}]},"fileUrl":{"type":"string","description":"File URL"},"extractedAt":{"type":"string","description":"Extracted at","format":"date-time"},"sourceReference":{"type":"string","description":"Source reference such as sender or SFTP path"},"emailFrom":{"type":"string","description":"Inbound sender email address"},"emailSubject":{"type":"string","description":"Inbound email subject"},"emailForwardedBy":{"type":"string","description":"Email address of the person who forwarded this email (when the document arrived via a forwarded email)"},"receivedAt":{"type":"string","description":"When the inbound document was received","format":"date-time"},"approvalSubmittedAt":{"type":"string","description":"When the current approval request was submitted","format":"date-time"},"approvalCompletedAt":{"type":"string","description":"When the latest approval request completed","format":"date-time"},"codingUpdatedAt":{"type":"string","description":"When the invoice coding payload was last updated","format":"date-time"},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"jsonPayload":{"type":"object","description":"JSON payload"},"errorMessage":{"type":"string","description":"Error message"},"currency":{"type":"string","description":"Transaction currency code (ISO 4217)"},"currencyRate":{"type":"number","description":"Exchange rate relative to company base currency"},"insuranceMetadata":{"description":"Insurance metadata (only included with ?include=insuranceIds)","allOf":[{"$ref":"#/components/schemas/DocumentInsuranceMetadataResponse"}]},"claimVerificationEnabled":{"type":"boolean","description":"Whether claim verification features are enabled for the tenant and can be surfaced in the UI"},"semanticMatchState":{"type":"string","description":"Human validation state for invoice semantic matching","enum":["PENDING","SEMANTIC_MATCH_APPROVED","SEMANTIC_MATCH_REJECTED"]},"companyId":{"type":"string","description":"QuickBooks company ID (for multi-company support)"},"companyName":{"type":"string","description":"QuickBooks company name (for multi-company support)"},"branchId":{"type":"string","description":"Branch (location) the bill belongs to.","nullable":true},"branchName":{"type":"string","description":"Branch name.","nullable":true}},"required":["id","supplierId","type","status","source","approvalStatus","codingStatus","needsReview","createdAt"]},"DocumentListResponse":{"type":"object","properties":{"data":{"description":"List of documents","type":"array","items":{"$ref":"#/components/schemas/DocumentResponse"}},"nextCursor":{"type":"string","description":"Pagination cursor for next page"}},"required":["data"]},"DocumentApprovalQueueItemDto":{"type":"object","properties":{"approvalRequestId":{"type":"string"},"documentId":{"type":"string"},"matchId":{"type":"string","nullable":true},"match":{"type":"object","nullable":true,"description":"Lightweight match summary for approval deep-linking."},"invoiceNumber":{"type":"string"},"supplierName":{"type":"string"},"totalAmount":{"type":"number"},"workflowRuleName":{"type":"string"},"submittedAt":{"type":"string","format":"date-time"},"ageHours":{"type":"number"}},"required":["approvalRequestId","documentId","submittedAt","ageHours"]},"DocumentApprovalQueueResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentApprovalQueueItemDto"}}},"required":["data"]},"UpdateDocumentRequestDto":{"type":"object","properties":{"needsReview":{"type":"boolean","description":"Whether the document still requires manual review."},"needsReviewReason":{"type":"string","description":"Reason for the review flag when needsReview is true."},"poNumber":{"type":"string","description":"Corrected purchase order number for the document header.","nullable":true},"invoiceNumber":{"type":"string","description":"Corrected invoice number for the document header.","nullable":true},"deliveryNoteNumber":{"type":"string","description":"Corrected delivery note number for the document header.","nullable":true},"branchId":{"type":"string","description":"Branch (location) the bill belongs to. Pass null to clear it.","nullable":true}}},"DocumentCodingSplitDto":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"percentage":{"type":"number"},"glCode":{"type":"string"},"glAccountId":{"type":"string"},"department":{"type":"string"},"costCenter":{"type":"string"},"project":{"type":"string"},"codingSource":{"type":"string","enum":["MANUAL","AI_SUGGESTED","AI_CONFIRMED"]}},"required":["id","amount"]},"UpdateDocumentCodingLineDto":{"type":"object","properties":{"lineId":{"type":"string","description":"Stable line identifier. Use line_id from OCR when available, otherwise line-{index}."},"amount":{"type":"number"},"glCode":{"type":"string"},"glAccountId":{"type":"string"},"department":{"type":"string"},"costCenter":{"type":"string"},"project":{"type":"string"},"codingSource":{"type":"string","enum":["MANUAL","AI_SUGGESTED","AI_CONFIRMED"]},"splits":{"description":"Optional split coding allocations for the line.","type":"array","items":{"$ref":"#/components/schemas/DocumentCodingSplitDto"}}},"required":["lineId","amount"]},"UpdateDocumentCodingRequestDto":{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/UpdateDocumentCodingLineDto"}}},"required":["lines"]},"PatchDocumentLineCodingRequestDto":{"type":"object","properties":{"glAccountId":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"costCenter":{"type":"string","nullable":true},"codingSource":{"type":"string","enum":["MANUAL","AI_SUGGESTED","AI_CONFIRMED"]}}},"UpsertDocumentLineSplitsRequestDto":{"type":"object","properties":{"splits":{"type":"array","items":{"$ref":"#/components/schemas/DocumentCodingSplitDto"}}},"required":["splits"]},"DocumentApprovalStepDto":{"type":"object","properties":{"id":{"type":"string"},"approverUserId":{"type":"string"},"approverEmail":{"type":"string"},"approverName":{"type":"string"},"approverRole":{"type":"string","enum":["OWNER","ADMIN","MEMBER"],"nullable":true},"delegatedFromUserId":{"type":"string"},"delegatedFromEmail":{"type":"string"},"delegatedFromName":{"type":"string"},"stepOrder":{"type":"number"},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED","SKIPPED"]},"isCurrent":{"type":"boolean"},"decisionComment":{"type":"string"},"decidedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","approverUserId","stepOrder","status","isCurrent"]},"DocumentApprovalRequestDto":{"type":"object","properties":{"id":{"type":"string"},"workflowRuleId":{"type":"string"},"workflowRuleName":{"type":"string"},"submittedByUserId":{"type":"string"},"status":{"type":"string","enum":["NOT_REQUIRED","NOT_SUBMITTED","PENDING","AWAITING_ESCALATION","APPROVED","REJECTED"]},"submittedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true},"routingSource":{"type":"string","enum":["RULE","AI_SUGGESTION","MANUAL"],"description":"RULE when a workflow rule routed the invoice; AI_SUGGESTION / MANUAL when no rule matched and a user assigned the approver."},"suggestedApproverId":{"type":"string","nullable":true,"description":"Approver suggested by the Approval Concierge when no rule matched (recorded even if someone else was assigned)."},"suggestionConfidence":{"type":"number","nullable":true,"description":"0..1"},"suggestionReason":{"type":"string","nullable":true},"suggestionSource":{"type":"string","nullable":true,"enum":["HISTORICAL_PATTERN","OWNER_FALLBACK"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/DocumentApprovalStepDto"}}},"required":["id","status","submittedAt","routingSource","steps"]},"DocumentApprovalResponseDto":{"type":"object","properties":{"approval":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/DocumentApprovalRequestDto"}]}}},"ApproverSuggestionAlternativeDto":{"type":"object","properties":{"approverUserId":{"type":"string"},"approverName":{"type":"string"},"approverEmail":{"type":"string"},"approverRole":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"approverMatchCount":{"type":"number"}},"required":["approverUserId","approverName","approverEmail","approverRole","approverMatchCount"]},"ApproverSuggestionDto":{"type":"object","properties":{"approverUserId":{"type":"string"},"approverName":{"type":"string"},"approverEmail":{"type":"string"},"approverRole":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"confidence":{"type":"number","description":"0..1"},"reason":{"type":"string"},"source":{"type":"string","enum":["HISTORICAL_PATTERN","OWNER_FALLBACK"]},"similarInvoiceCount":{"type":"number","description":"Distinct similar invoices the suggestion is based on."},"approverMatchCount":{"type":"number","description":"How many of those the suggested approver approved."},"alternatives":{"type":"array","items":{"$ref":"#/components/schemas/ApproverSuggestionAlternativeDto"}}},"required":["approverUserId","approverName","approverEmail","approverRole","confidence","reason","source","similarInvoiceCount","approverMatchCount","alternatives"]},"ApproverCandidateDto":{"type":"object","properties":{"approverUserId":{"type":"string"},"approverName":{"type":"string"},"approverEmail":{"type":"string"},"approverRole":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]}},"required":["approverUserId","approverName","approverEmail","approverRole"]},"DocumentApprovalRoutingResponseDto":{"type":"object","properties":{"ruleMatched":{"type":"boolean","description":"Whether an enabled approval rule covers this invoice."},"workflowRuleId":{"type":"string","nullable":true},"workflowRuleName":{"type":"string","nullable":true},"suggestion":{"nullable":true,"description":"Approval Concierge suggestion; only present when no rule matched.","type":"object","allOf":[{"$ref":"#/components/schemas/ApproverSuggestionDto"}]},"approverCandidates":{"description":"Workspace users who can be assigned when no rule matched (empty when a rule matched).","type":"array","items":{"$ref":"#/components/schemas/ApproverCandidateDto"}}},"required":["ruleMatched","approverCandidates"]},"SubmitDocumentApprovalRequestDto":{"type":"object","properties":{"comment":{"type":"string","description":"Optional comment recorded against the approval submission."},"approverUserId":{"type":"string","description":"Approver to assign when no approval rule matches the invoice (the Approval Concierge suggestion or a user-chosen approver). Rejected when a rule matches."}}},"DocumentApprovalDecisionRequestDto":{"type":"object","properties":{"action":{"type":"string","enum":["APPROVE","REJECT","RETURN"]},"comment":{"type":"string","description":"Optional approver comment."}},"required":["action"]},"DocumentWritebackStatusDto":{"type":"object","properties":{"documentId":{"type":"string"},"provider":{"type":"string","nullable":true},"status":{"type":"string","enum":["PENDING","PROCESSING","ACKNOWLEDGED","FAILED","NEEDS_RECONCILIATION"],"nullable":true},"attemptCount":{"type":"number"},"externalId":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time","nullable":true},"acknowledgedAt":{"type":"string","format":"date-time","nullable":true}},"required":["documentId","attemptCount"]},"DocumentPaymentResponseDto":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"status":{"type":"string","enum":["SCHEDULED","PROCESSING","SENT","FAILED","CANCELLED"]},"method":{"type":"string","enum":["ACH","CHECK","WIRE","ERP_SYNC"]},"scheduledAt":{"type":"string","format":"date-time"},"processedAt":{"type":"string","format":"date-time","nullable":true},"amount":{"type":"number"},"remittanceEmail":{"type":"string"},"remittanceNote":{"type":"string"},"externalReference":{"type":"string"}},"required":["id","documentId","status","method","scheduledAt","amount"]},"DocumentPaymentEnvelopeDto":{"type":"object","properties":{"payment":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/DocumentPaymentResponseDto"}]}}},"ScheduleDocumentPaymentRequestDto":{"type":"object","properties":{"method":{"type":"string","enum":["ACH","CHECK","WIRE","ERP_SYNC"]},"scheduledAt":{"type":"string","format":"date-time"},"remittanceEmail":{"type":"string"},"remittanceNote":{"type":"string"},"sendRemittance":{"type":"boolean"}},"required":["method","scheduledAt"]},"DocumentDownloadUrlResponse":{"type":"object","properties":{"url":{"type":"string","description":"Temporary download URL for the document","example":"https://storage.example.com/temp/doc123.pdf"}},"required":["url"]},"DocumentPreviewResponse":{"type":"object","properties":{"url":{"type":"string","description":"Temporary signed URL for preview or download.","example":"https://storage.example.com/temp/doc123.pdf"},"previewKind":{"type":"string","description":"Browser rendering mode selected for this file.","enum":["image","pdf","text","download"]},"fileName":{"type":"string","description":"Original file name."},"mimeType":{"type":"string","description":"Stored MIME type."},"canPreviewInline":{"type":"boolean","description":"Whether the drawer can render the file inline."},"expiresAt":{"type":"string","description":"Signed URL expiry timestamp."},"unsupportedReason":{"type":"string","description":"Unsupported-format recovery guidance."}},"required":["url","previewKind","canPreviewInline","expiresAt"]},"UpdateInsuranceMetadataRequest":{"type":"object","properties":{"claimId":{"type":"string","description":"Insurance claim ID"},"policyId":{"type":"string","description":"Insurance policy ID"},"treatyId":{"type":"string","description":"Insurance treaty ID"},"lob":{"type":"string","description":"Insurance line of business"}}},"ValidationResultResponse":{"type":"object","properties":{"idType":{"type":"string","description":"Identifier field name"},"value":{"type":"string","description":"Candidate value being validated"},"isValid":{"type":"boolean","description":"Whether the value passed validation"},"message":{"type":"string","description":"Validation outcome message"}},"required":["idType","value","isValid","message"]},"InsuranceMetadataValidationResponse":{"type":"object","properties":{"validationResults":{"description":"Validation results for each identifier field","type":"array","items":{"$ref":"#/components/schemas/ValidationResultResponse"}}},"required":["validationResults"]},"SemanticMatchSuggestionDTO":{"type":"object","properties":{"kind":{"type":"string","description":"Candidate type","enum":["CLAIM","POLICY"]},"id":{"type":"string","description":"Candidate identifier value"},"similarity":{"type":"number","description":"Similarity score 0..1"},"rawSimilarity":{"type":"number","description":"Raw embedding similarity score before any reranking"}},"required":["kind","id","similarity","rawSimilarity"]},"GetSemanticMatchesResponseDTO":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SemanticMatchSuggestionDTO"}}},"required":["data"]},"PatchSemanticMatchRequestDTO":{"type":"object","properties":{"action":{"type":"string","description":"Action to take","enum":["APPROVE","REJECT","PICK_OTHER"]},"kind":{"type":"string","description":"Selected candidate kind. Required for PICK_OTHER and optional for APPROVE so the backend can persist labelled feedback.","enum":["CLAIM","POLICY"]},"id":{"type":"string","description":"Selected candidate identifier. Required for PICK_OTHER and optional for APPROVE so the backend can persist labelled feedback."},"shownCandidates":{"description":"Candidate list shown to the user at decision time. When provided, the backend uses this exact snapshot instead of recomputing candidates.","type":"array","items":{"$ref":"#/components/schemas/SemanticMatchSuggestionDTO"}}},"required":["action"]},"PatchSemanticMatchResponseDTO":{"type":"object","properties":{"state":{"type":"string","description":"Updated state","enum":["PENDING","SEMANTIC_MATCH_APPROVED","SEMANTIC_MATCH_REJECTED"]}},"required":["state"]},"ExceptionDTO":{"type":"object","properties":{"id":{"type":"string","description":"Exception ID","format":"uuid"},"matchId":{"type":"string","description":"Associated match ID","format":"uuid"},"lineId":{"type":"string","description":"Associated line item ID","format":"uuid"},"reason":{"type":"string","description":"Exception reason"},"status":{"type":"string","description":"Exception status","enum":["OPEN","INVESTIGATING","AWAITING_VENDOR","PENDING_SUPPLIER","RESOLUTION_PROPOSED","ESCALATED","RESOLVED"]},"slaDue":{"type":"string","description":"SLA due date","format":"date-time","nullable":true},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"resolvedAt":{"type":"string","description":"Resolution timestamp","format":"date-time"},"supplierName":{"type":"string","description":"Supplier name","nullable":true},"supplierEmail":{"type":"string","description":"Supplier email","format":"email","nullable":true},"investigationPayload":{"type":"object","description":"Structured investigation output for this exception."},"investigationConfidence":{"type":"number","description":"Confidence score from exception investigation (0-100).","example":82},"suggestedResolution":{"type":"object","description":"Suggested resolution generated by the exception operator."},"communicationTemplate":{"type":"string","description":"Template used for latest vendor communication.","enum":["MISSING_PO","W9_REQUEST","PAYMENT_STATUS","GENERAL_EXCEPTION"]},"communicationSequenceStep":{"type":"number","description":"Current step in vendor communication sequence.","example":1},"nextSupplierReminderAt":{"type":"string","description":"Timestamp for the next automated reminder to supplier.","format":"date-time","nullable":true},"vendorThreadId":{"type":"string","description":"Tracked email thread identifier for vendor communication."},"lobCode":{"type":"string","description":"Insurance line of business (e.g. CYBER, PROPERTY) that triggered the tolerance breach.","nullable":true},"variancePct":{"type":"string","description":"Match-level price variance percent against the LOB tolerance rule.","nullable":true},"varianceAbs":{"type":"string","description":"Match-level price variance absolute against the LOB tolerance rule.","nullable":true},"toleranceRuleId":{"type":"string","description":"LobToleranceRule id referenced by this exception, for audit.","nullable":true},"assignedUserId":{"type":"string","description":"User id assigned as first approver via the LOB approver route.","nullable":true}},"required":["id","matchId","reason","status","createdAt"]},"ExceptionListResponse":{"type":"object","properties":{"data":{"description":"List of exceptions","type":"array","items":{"$ref":"#/components/schemas/ExceptionDTO"}},"nextCursor":{"type":"string","description":"Pagination cursor for next page"}},"required":["data"]},"TriggerExceptionInvestigationRequest":{"type":"object","properties":{"autoApply":{"type":"boolean","description":"If true and confidence is high enough, applies the suggested resolution immediately.","example":false}}},"ExceptionInvestigationResponse":{"type":"object","properties":{"id":{"type":"string","description":"Exception ID","format":"uuid"},"status":{"type":"string","description":"Current exception status after investigation","enum":["OPEN","INVESTIGATING","AWAITING_VENDOR","PENDING_SUPPLIER","RESOLUTION_PROPOSED","ESCALATED","RESOLVED"]},"confidencePct":{"type":"number","description":"Investigation confidence score (0-100)","example":78},"recommendation":{"type":"string","description":"Action recommendation from investigator","example":"MARK_READY_FOR_REVIEW"},"suggestedResolution":{"type":"object","description":"Suggested resolution payload"},"candidates":{"description":"Top candidate matches found by the investigator","type":"array","items":{"type":"string"}}},"required":["id","status","confidencePct","recommendation"]},"ExceptionResolutionDecisionRequest":{"type":"object","properties":{"comment":{"type":"string","description":"Optional reviewer comment for accept/reject actions."}}},"ExceptionUpdateRequest":{"type":"object","properties":{"status":{"type":"string","description":"New status for the exception","enum":["OPEN","INVESTIGATING","AWAITING_VENDOR","PENDING_SUPPLIER","RESOLUTION_PROPOSED","ESCALATED","RESOLVED"]},"slaDue":{"type":"string","description":"New SLA due date","format":"date-time"}}},"EvidenceDetailsDTO":{"type":"object","properties":{"id":{"type":"string","description":"ID of the evidence record.","example":"clxkz8qnk000408lb4g79g2k2"},"fileName":{"type":"string","description":"Original filename of the evidence.","example":"invoice_scan.pdf"},"mimeType":{"type":"string","description":"MIME type of the file.","example":"application/pdf"},"fileSizeBytes":{"type":"number","description":"Size of the file in bytes.","example":102400},"comment":{"type":"string","description":"User-provided comment specific to this piece of evidence."},"uploadedAt":{"type":"string","description":"Timestamp of when the evidence was uploaded."},"downloadUrl":{"type":"string","description":"A pre-signed URL to download the evidence file."}},"required":["id","fileName","uploadedAt"]},"ExceptionHistoryEventDTO":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the history event.","example":"clxkz8qnk000208lb7003h5g1"},"action":{"type":"string","description":"Action performed.","enum":["CREATED","APPROVED","DISPUTED","EMAIL_SENT","EMAIL_RECEIVED","SUPPLIER_ACK","RESOLVED","REOPENED","SLA_UPDATED","STATUS_UPDATED","ESCALATED","COMMENT_ADDED","EVIDENCE_UPLOADED"]},"comment":{"type":"string","description":"General comment associated with the history event. For evidence uploads, this might be 'Evidence uploaded: filename.ext'."},"timestamp":{"type":"string","description":"Timestamp of the event in ISO format."},"actorType":{"type":"string","description":"Type of actor performing the action.","enum":["SYSTEM","USER"]},"userId":{"type":"string","description":"ID of the user who performed the action, if applicable."},"userName":{"type":"string","description":"Name of the user who performed the action, if applicable."},"evidence":{"description":"Details of the evidence, if this event is an evidence upload.","allOf":[{"$ref":"#/components/schemas/EvidenceDetailsDTO"}]}},"required":["id","action","timestamp","actorType"]},"ExceptionHistoryResponse":{"type":"object","properties":{"history":{"description":"List of history events","type":"array","items":{"$ref":"#/components/schemas/ExceptionHistoryEventDTO"}}},"required":["history"]},"ExceptionPresenceItemDto":{"type":"object","properties":{"userId":{"type":"string","description":"Clerk user id of active collaborator."},"userName":{"type":"string","description":"Display name for the active collaborator."},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"isCurrentUser":{"type":"boolean","description":"Whether this presence row belongs to the current user."},"lastSeenAt":{"type":"string","format":"date-time"}},"required":["userId","userName","role","isCurrentUser","lastSeenAt"]},"ExceptionPresenceResponseDto":{"type":"object","properties":{"exceptionId":{"type":"string"},"activeUsers":{"type":"array","items":{"$ref":"#/components/schemas/ExceptionPresenceItemDto"}},"serverTime":{"type":"string","format":"date-time"}},"required":["exceptionId","activeUsers","serverTime"]},"EmailSupplierRequest":{"type":"object","properties":{"subject":{"type":"string","description":"Custom email subject line"},"bodyMarkdown":{"type":"string","description":"Custom email body in markdown format"},"template":{"type":"string","description":"Template used for deterministic vendor communication fallback","enum":["MISSING_PO","W9_REQUEST","PAYMENT_STATUS","GENERAL_EXCEPTION"]}}},"EmailSupplierResponse":{"type":"object","properties":{"sentAt":{"type":"string","description":"Timestamp when email was sent","format":"date-time"},"deliveryStatus":{"type":"string","description":"Email delivery status","enum":["SENT","BOUNCED","QUEUED"]},"threadId":{"type":"string","description":"Email thread identifier for follow-up and inbound routing."}},"required":["sentAt","deliveryStatus"]},"AddCommentPayload":{"type":"object","properties":{"comment":{"type":"string","description":"The content of the comment to add.","example":"Checked with supplier, awaiting their response."},"mentions":{"description":"Optional Prisma user IDs mentioned in the comment. Mention notifications are generated from these IDs.","example":["usr_123"],"type":"array","items":{"type":"string"}}},"required":["comment"]},"AddEvidencePayload":{"type":"object","properties":{"comment":{"type":"string","description":"Optional comment to associate with the evidence.","example":"Attached is the signed delivery note."},"evidenceFile":{"type":"string","format":"binary","description":"The evidence file to upload."}},"required":["evidenceFile"]},"MatchSummaryDTO":{"type":"object","properties":{"id":{"type":"string","description":"Match ID","format":"uuid"},"poNumber":{"type":"string","description":"Purchase Order number"},"matchType":{"type":"string","description":"Match mode, for example TWO_WAY or THREE_WAY"},"notes":{"type":"string","description":"Evidence source or processing notes for this match"},"supplierName":{"type":"string","description":"Supplier name"},"status":{"type":"string","description":"Match status","enum":["CLEARED","CLEARED_MANUAL","EXCEPTION","PENDING_SUPPLIER","PENDING_QA","RESOLVED","FAILED","SUPERSEDED","PARTIAL_INVOICE"]},"totalPriceVariancePct":{"type":"number","description":"Total price variance percentage"},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"clearedAt":{"type":"string","description":"Cleared timestamp","format":"date-time"}},"required":["id","poNumber","supplierName","status","totalPriceVariancePct","createdAt"]},"MatchListResponse":{"type":"object","properties":{"data":{"description":"List of matches","type":"array","items":{"$ref":"#/components/schemas/MatchSummaryDTO"}},"nextCursor":{"type":"string","description":"Pagination cursor for next page"}},"required":["data"]},"MatchHeaderResponse":{"type":"object","properties":{"id":{"type":"string","description":"Match ID","format":"uuid"},"poNumber":{"type":"string","description":"Purchase Order number"},"matchType":{"type":"string","description":"Match mode, for example TWO_WAY or THREE_WAY"},"notes":{"type":"string","description":"Evidence source or processing notes for this match"},"supplierName":{"type":"string","description":"Supplier name"},"status":{"type":"string","description":"Match status","enum":["CLEARED","CLEARED_MANUAL","EXCEPTION","PENDING_SUPPLIER","PENDING_QA","RESOLVED","FAILED","SUPERSEDED","PARTIAL_INVOICE"]},"totalPriceVariancePct":{"type":"number","description":"Total price variance percentage"},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"clearedAt":{"type":"string","description":"Cleared timestamp","format":"date-time"}},"required":["id","poNumber","supplierName","status","totalPriceVariancePct","createdAt"]},"MatchLineItemDTO":{"type":"object","properties":{"lineId":{"type":"string","description":"Line item ID","format":"uuid"},"sku":{"type":"string","description":"Product SKU"},"description":{"type":"string","description":"Product description"},"poQty":{"type":"number","description":"Purchase order quantity"},"invQty":{"type":"number","description":"Inventory quantity"},"delQty":{"type":"number","description":"Delivery quantity"},"poUnitPrice":{"type":"number","description":"Purchase order unit price"},"invUnitPrice":{"type":"number","description":"Invoice unit price"},"priceVar":{"type":"number","description":"Absolute price variance"},"priceVarPct":{"type":"number","description":"Price variance percentage"},"qtyVar":{"type":"number","description":"Absolute quantity variance"},"qtyVarPct":{"type":"number","description":"Quantity variance percentage"},"taxVar":{"type":"number","description":"Tax variance"},"status":{"type":"string","description":"Line item status","enum":["OK","VARIANT","APPROVED","DISPUTED","PARTIAL"]},"sourcePoLineId":{"type":"string","description":"Source purchase-order line identifier"},"sourceInvLineId":{"type":"string","description":"Source invoice line identifier"},"sourceDelLineId":{"type":"string","description":"Source delivery-note line identifier"},"evidenceSummary":{"type":"string","description":"Human-readable evidence summary"},"toleranceExplanation":{"type":"string","description":"Human-readable tolerance explanation"},"recommendedAction":{"type":"string","description":"Recommended operator action"},"confidence":{"type":"number","description":"Line-level match confidence from 0 to 1"},"costCodeId":{"type":"string","description":"Per-line cost-code override"}},"required":["lineId","description","status"]},"MatchLineListResponse":{"type":"object","properties":{"data":{"description":"List of match line items","type":"array","items":{"$ref":"#/components/schemas/MatchLineItemDTO"}},"nextCursor":{"type":"string","description":"Pagination cursor for next page"}},"required":["data"]},"ApproveMatchRequest":{"type":"object","properties":{"comment":{"type":"string","description":"Comment"}}},"DisputeMatchRequest":{"type":"object","properties":{"comment":{"type":"string","description":"Comment"},"reason":{"type":"string","description":"Reason for dispute"}},"required":["reason"]},"SplitLinesRequest":{"type":"object","properties":{"approve":{"description":"Line IDs to approve","type":"array","items":{"type":"string"}},"dispute":{"description":"Line IDs to dispute","type":"array","items":{"type":"string"}}},"required":["approve","dispute"]},"BulkActionRequest":{"type":"object","properties":{"matchIds":{"description":"List of Match UUIDs to perform the action on.","example":["uuid1","uuid2"],"type":"array","items":{"type":"string"}}},"required":["matchIds"]},"BulkActionError":{"type":"object","properties":{"matchId":{"type":"string","description":"The Match ID that failed.","format":"uuid"},"message":{"type":"string","description":"The reason for the failure."}},"required":["matchId","message"]},"BulkApproveResponse":{"type":"object","properties":{"approvedCount":{"type":"number","description":"Number of matches successfully approved."},"errors":{"description":"List of errors encountered during bulk approval.","type":"array","items":{"$ref":"#/components/schemas/BulkActionError"}}},"required":["approvedCount"]},"BulkDisputeResponse":{"type":"object","properties":{"disputedCount":{"type":"number","description":"Number of matches successfully disputed."},"errors":{"description":"List of errors encountered during bulk dispute.","type":"array","items":{"$ref":"#/components/schemas/BulkActionError"}}},"required":["disputedCount"]},"JoinLinesRequest":{"type":"object","properties":{"lineIds":{"description":"Array of line IDs to join.","example":["uuid1-line-a","uuid2-line-b"],"type":"array","items":{"type":"string"}}},"required":["lineIds"]},"UpdateMatchCodingDto":{"type":"object","properties":{}},"MatchDecisionDTO":{"type":"object","properties":{"decision":{"type":"string","description":"First-party match decision derived from deterministic checks.","enum":["CLEARABLE","REVIEW_PARTIAL","HOLD","NEEDS_CORRECTION"]},"reasonCode":{"type":"string","description":"Machine-readable reason for the decision.","enum":["MATCH_CLEARED","POSSIBLE_PARTIAL_INVOICE","NON_PO_EVIDENCE_MATCH","MISSING_PO_REFERENCE","NO_MATERIAL_VARIANCE","WRONG_PO_REFERENCE","PRICE_VARIANCE","QUANTITY_VARIANCE","MISSING_RECEIPT","MISSING_PO","INVOICE_NEEDS_REVIEW","LINE_VARIANCE","PROCESSING_FAILED","INSUFFICIENT_EVIDENCE"]},"confidence":{"type":"number","description":"Confidence in the deterministic decision, from 0 to 1.","minimum":0,"maximum":1},"summary":{"type":"string","description":"Short human-readable decision summary."},"nextAction":{"type":"string","description":"Recommended next action."},"evidence":{"description":"Evidence used by the deterministic decision layer.","type":"array","items":{"type":"string"}}},"required":["decision","reasonCode","confidence","summary","nextAction","evidence"]},"RecommendationDTO":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID for the recommendation","format":"uuid"},"text":{"type":"string","description":"The text content of the recommendation."},"type":{"type":"string","description":"The type of recommendation.","enum":["info","warning","suggestion","error"]},"relatedLineIds":{"description":"Optional array of line IDs this recommendation specifically relates to.","type":"array","items":{"type":"string","format":"uuid"}},"source":{"type":"string","description":"Where the recommendation came from.","enum":["AI","SYSTEM"]}},"required":["id","text","type"]},"GetMatchRecommendationsResponse":{"type":"object","properties":{"decision":{"description":"Deterministic first-party decision for this match.","allOf":[{"$ref":"#/components/schemas/MatchDecisionDTO"}]},"data":{"description":"List of AI-generated recommendations.","type":"array","items":{"$ref":"#/components/schemas/RecommendationDTO"}}},"required":["data"]},"MatchingConfigDto":{"type":"object","properties":{"skuMatch":{"type":"boolean"},"fuzzyThreshold":{"type":"number","minimum":0,"maximum":1},"embeddingThreshold":{"type":"number","minimum":0,"maximum":1},"allowManyToOne":{"type":"boolean"},"varianceAggregation":{"type":"string","enum":["WEIGHTED","MEAN"]},"partialInvoicingEnabled":{"type":"boolean"},"partialInvoiceTolerancePct":{"type":"number","minimum":0,"maximum":1},"sourceProfiles":{"type":"object","description":"Optional source-specific matching overrides, such as quickbooks.itemBased and quickbooks.accountBased."}},"required":["skuMatch","fuzzyThreshold","embeddingThreshold","allowManyToOne","varianceAggregation"]},"UpdateMatchingConfigDto":{"type":"object","properties":{"skuMatch":{"type":"boolean"},"fuzzyThreshold":{"type":"number","minimum":0,"maximum":1},"embeddingThreshold":{"type":"number","minimum":0,"maximum":1},"allowManyToOne":{"type":"boolean"},"varianceAggregation":{"type":"string","enum":["WEIGHTED","MEAN"]},"partialInvoicingEnabled":{"type":"boolean"},"partialInvoiceTolerancePct":{"type":"number","minimum":0,"maximum":1},"sourceProfiles":{"type":"object"}},"required":["skuMatch","fuzzyThreshold","embeddingThreshold","allowManyToOne","varianceAggregation"]},"UpdateMatchingConfigResponseDto":{"type":"object","properties":{"config":{"$ref":"#/components/schemas/MatchingConfigDto"},"emitted":{"type":"boolean"}},"required":["config","emitted"]},"GlobalToleranceDto":{"type":"object","properties":{"pricePct":{"type":"number","minimum":0,"maximum":100},"qtyUnits":{"type":"number","minimum":0},"taxPct":{"type":"number","minimum":0,"maximum":100},"ignoreTaxLines":{"type":"boolean"}},"required":["pricePct","qtyUnits","taxPct","ignoreTaxLines"]},"UpdateGlobalToleranceDto":{"type":"object","properties":{"pricePct":{"type":"number","minimum":0,"maximum":100},"qtyUnits":{"type":"number","minimum":0},"taxPct":{"type":"number","minimum":0,"maximum":100},"ignoreTaxLines":{"type":"boolean"}},"required":["pricePct","qtyUnits","taxPct","ignoreTaxLines"]},"ToleranceProfileDefaultsDto":{"type":"object","properties":{"pricePct":{"type":"number","description":"Price variance threshold as a fraction (0.02 = 2 %)."},"qtyUnits":{"type":"number","description":"Quantity variance threshold in absolute units."},"taxPct":{"type":"number","description":"Tax variance threshold as a fraction (0.005 = 0.5 %)."},"ignoreTaxLines":{"type":"boolean","description":"When true the engine ignores tax line variances."}},"required":["pricePct","qtyUnits","taxPct","ignoreTaxLines"]},"ToleranceProfileDto":{"type":"object","properties":{"name":{"type":"string","description":"Profile key, e.g. \"CONSTRUCTION\"."},"description":{"type":"string","description":"Human-readable description of this profile."},"defaults":{"$ref":"#/components/schemas/ToleranceProfileDefaultsDto"}},"required":["name","description","defaults"]},"ApplyToleranceProfileDto":{"type":"object","properties":{"profileName":{"type":"string","description":"The name of the tolerance profile to apply.","example":"CONSTRUCTION"}},"required":["profileName"]},"ControlsMonitorMetricDto":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"}},"required":["key","label","count"]},"ControlsMonitorItemDto":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string"},"lob":{"type":"string"},"detectedAt":{"type":"string"},"agedHours":{"type":"number"},"status":{"type":"string"},"route":{"type":"string"}},"required":["id","type","title","description","severity","detectedAt","agedHours","route"]},"ControlsMonitorResponseDto":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/ControlsMonitorMetricDto"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/ControlsMonitorItemDto"}},"availableLobs":{"type":"array","items":{"type":"string"}},"generatedAt":{"type":"string"}},"required":["metrics","items","availableLobs","generatedAt"]},"EntityFxConfigDto":{"type":"object","properties":{"id":{"type":"string"},"entityId":{"type":"string"},"baseCurrency":{"type":"string","example":"EUR","description":"ISO-4217 base currency."},"conversionMethod":{"type":"string","enum":["SPOT","MONTHLY_AVERAGE","CUSTOM_TABLE"]},"customRateSource":{"type":"string","description":"Identifier for the custom rate table (Story 5.6). Required when conversionMethod is CUSTOM_TABLE."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastChangedAt":{"type":"string","format":"date-time"},"lastChangedByName":{"type":"string"},"lastChangedByEmail":{"type":"string"}},"required":["id","entityId","baseCurrency","conversionMethod","createdAt","updatedAt"]},"EntityFxConfigListEntryDto":{"type":"object","properties":{"entityId":{"type":"string"},"entityName":{"type":"string"},"entityCode":{"type":"string"},"config":{"$ref":"#/components/schemas/EntityFxConfigDto"}},"required":["entityId","entityName","entityCode"]},"EntityFxConfigListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EntityFxConfigListEntryDto"}}},"required":["data"]},"UpsertEntityFxConfigDto":{"type":"object","properties":{"baseCurrency":{"type":"string","description":"ISO-4217 base currency code (three uppercase letters).","example":"EUR"},"conversionMethod":{"type":"string","enum":["SPOT","MONTHLY_AVERAGE","CUSTOM_TABLE"]},"customRateSource":{"type":"string","description":"Identifier for the custom rate table (Story 5.6). Required when conversionMethod is CUSTOM_TABLE."}},"required":["baseCurrency","conversionMethod"]},"LobApproverRouteDto":{"type":"object","properties":{"id":{"type":"string"},"lobCode":{"type":"string"},"approverUserId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","lobCode","approverUserId","createdAt","updatedAt"]},"UpsertLobApproverRouteDto":{"type":"object","properties":{"approverUserId":{"type":"string","description":"Prisma User id of the approver (must belong to tenant)."}},"required":["approverUserId"]},"LobToleranceRuleDto":{"type":"object","properties":{"id":{"type":"string"},"lobCode":{"type":"string"},"matchType":{"type":"string","enum":["TWO_WAY","THREE_WAY","FOUR_WAY"]},"percentVariance":{"type":"string"},"absoluteVariance":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","lobCode","matchType","percentVariance","absoluteVariance","createdAt","updatedAt"]},"UpsertLobToleranceDto":{"type":"object","properties":{"percentVariance":{"type":"number","description":"Percentage variance threshold (0-100).","minimum":0,"maximum":100},"absoluteVariance":{"type":"number","description":"Absolute variance threshold (>= 0).","minimum":0}},"required":["percentVariance","absoluteVariance"]},"CreatePurchaseOrderDto":{"type":"object","properties":{}},"PurchaseOrdersPaginatedResponseDto":{"type":"object","properties":{}},"PurchaseOrderIntegrationStatusResponseDto":{"type":"object","properties":{}},"RetryPurchaseOrderWritebackDto":{"type":"object","properties":{}},"PurchaseOrderResponseDto":{"type":"object","properties":{}},"UpdatePurchaseOrderLineDto":{"type":"object","properties":{"id":{"type":"string","description":"Line item ID (omit for new lines)"},"sku":{"type":"string","description":"Product SKU"},"description":{"type":"string","description":"Line item description","example":"Widget A"},"quantity":{"type":"number","description":"Quantity","example":1},"unitPrice":{"type":"number","description":"Unit price","example":10.5}},"required":["description","quantity","unitPrice"]},"UpdatePurchaseOrderDto":{"type":"object","properties":{"status":{"type":"string","description":"Purchase order status","enum":["PENDING","SUBMITTED","RECEIVED","CANCELLED","PARTIALLY_INVOICED","FULLY_INVOICED"]},"supplierId":{"type":"string","description":"Supplier ID","format":"uuid"},"orderDate":{"type":"string","description":"Order date in YYYY-MM-DD format","format":"date","example":"2024-05-01"},"currency":{"type":"string","description":"Currency code (ISO 4217)","example":"USD"},"currencyRate":{"type":"number","description":"Exchange rate relative to base currency","example":1.12},"lines":{"description":"Purchase order lines","type":"array","items":{"$ref":"#/components/schemas/UpdatePurchaseOrderLineDto"}}}},"GeneratePONumberResponse":{"type":"object","properties":{"poNumber":{"type":"string","description":"Generated purchase order number"}},"required":["poNumber"]},"CreateBuildPoDto":{"type":"object","properties":{}},"UpdateBuildPoDto":{"type":"object","properties":{}},"TrainingGovernanceDto":{"type":"object","properties":{"quickbooksPolicyReviewed":{"type":"boolean"},"quickbooksTrainingApproved":{"type":"boolean"},"quickbooksApprovedAt":{"type":"string"},"quickbooksApprovedBy":{"type":"string"},"notes":{"type":"string"}},"required":["quickbooksPolicyReviewed","quickbooksTrainingApproved"]},"UpdateTrainingGovernanceDto":{"type":"object","properties":{"quickbooksPolicyReviewed":{"type":"boolean"},"quickbooksTrainingApproved":{"type":"boolean"},"notes":{"type":"string"}}},"SubmitSurveyDto":{"type":"object","properties":{}},"CreateDemoBookingDto":{"type":"object","properties":{}},"DemoBookingAcceptedDto":{"type":"object","properties":{}},"ActivationTimelineStepDto":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["COMPLETE","PENDING","FAILED"]},"occurredAt":{"type":"string","nullable":true},"msFromSignup":{"type":"number","nullable":true},"provider":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"recoveryAction":{"type":"string","nullable":true}},"required":["key","label","status","occurredAt","msFromSignup"]},"ActivationTimelineDto":{"type":"object","properties":{"tenantId":{"type":"string"},"signupAt":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/ActivationTimelineStepDto"}},"activatedAt":{"type":"string","nullable":true},"timeToValueMs":{"type":"number","nullable":true},"underTenMinutes":{"type":"boolean","nullable":true}},"required":["tenantId","signupAt","steps","activatedAt","timeToValueMs","underTenMinutes"]},"DemoBookingAttributionDto":{"type":"object","properties":{}},"SessionTouchAcceptedDto":{"type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"]},"SupportProfileDto":{"type":"object","properties":{"standardSlaHours":{"type":"number"},"prioritySlaHours":{"type":"number"},"managerName":{"type":"string"},"managerEmail":{"type":"string"},"schedulerUrl":{"type":"string"},"notes":{"type":"string"}},"required":["standardSlaHours","prioritySlaHours"]},"SupportTicketMessageDto":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"authorEmail":{"type":"string"},"authorName":{"type":"string"},"isInternal":{"type":"boolean"},"generatedByAi":{"type":"boolean"},"providerMessageId":{"type":"string"},"inReplyToMessageId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","body","authorEmail","isInternal","generatedByAi","createdAt"]},"SupportTicketDto":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["OPEN","IN_PROGRESS","WAITING_ON_CUSTOMER","RESOLVED"]},"priority":{"type":"string","enum":["STANDARD","PRIORITY"]},"source":{"type":"string","enum":["PORTAL","EMAIL","SYSTEM"]},"requesterEmail":{"type":"string"},"assignedManagerEmail":{"type":"string"},"ownerNotificationEmail":{"type":"string"},"conversationEmail":{"type":"string"},"threadToken":{"type":"string"},"senderDisplayName":{"type":"string"},"senderSignature":{"type":"string"},"participantEmails":{"type":"array","items":{"type":"string"}},"aiEnabled":{"type":"boolean"},"aiStatus":{"type":"string","enum":["DISABLED","ACTIVE","HUMAN_REVIEW_REQUIRED"]},"aiEscalationReason":{"type":"string"},"aiEscalationSummary":{"type":"string"},"externalThreadId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"closedAt":{"type":"string","format":"date-time","nullable":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicketMessageDto"}}},"required":["id","subject","status","priority","source","requesterEmail","aiEnabled","aiStatus","createdAt","updatedAt","messages"]},"SupportTicketListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicketDto"}}},"required":["data"]},"CreateSupportTicketDto":{"type":"object","properties":{"subject":{"type":"string"},"description":{"type":"string"}},"required":["subject"]},"CreateSupportTicketMessageDto":{"type":"object","properties":{"body":{"type":"string"}},"required":["body"]},"UpdateSupportTicketDto":{"type":"object","properties":{"status":{"type":"string","enum":["OPEN","IN_PROGRESS","WAITING_ON_CUSTOMER","RESOLVED"]},"priority":{"type":"string","enum":["STANDARD","PRIORITY"]},"assignedManagerEmail":{"type":"string"}}},"UpdateSupportProfileDto":{"type":"object","properties":{"managerName":{"type":"string"},"managerEmail":{"type":"string"},"schedulerUrl":{"type":"string"},"notes":{"type":"string"}}},"UpdateEnterpriseOnboardingPlanDto":{"type":"object","properties":{"stage":{"type":"string","enum":["NOT_STARTED","KICKOFF_SCHEDULED","IN_PROGRESS","BLOCKED","COMPLETED"]},"kickoffScheduledAt":{"type":"string","format":"date-time"},"targetGoLiveAt":{"type":"string","format":"date-time"},"blockers":{"type":"array","items":{"type":"string"}},"notes":{"type":"string"},"completedAt":{"type":"string","format":"date-time"}}},"EnterpriseOnboardingPlanDto":{"type":"object","properties":{"stage":{"type":"string","enum":["NOT_STARTED","KICKOFF_SCHEDULED","IN_PROGRESS","BLOCKED","COMPLETED"]},"kickoffScheduledAt":{"type":"string","format":"date-time","nullable":true},"targetGoLiveAt":{"type":"string","format":"date-time","nullable":true},"blockers":{"nullable":true,"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["stage"]},"CreateMarketingEmailCaptureDto":{"type":"object","properties":{"email":{"type":"string","description":"Lead email address"},"firstName":{"type":"string","description":"Lead first name"},"company":{"type":"string","description":"Lead company name"},"productName":{"type":"string","description":"Waitlist or offer-specific product name"},"offerType":{"type":"string","enum":["ap_automation_checklist","comparison_email","roi_estimate","quickbooks_setup_plan","walkthrough","early_access","pricing_setup_guide","construction_ap_toolkit"]},"source":{"type":"string"},"pagePath":{"type":"string"},"pageUrl":{"type":"string"},"referrer":{"type":"string"},"referrerClass":{"type":"string"},"utmSource":{"type":"string"},"utmMedium":{"type":"string"},"utmCampaign":{"type":"string"},"utmContent":{"type":"string"},"deviceType":{"type":"string"},"website":{"type":"string","description":"Honeypot field. Must be left empty by real visitors."},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token from the capture form"}},"required":["email","offerType"]},"PublicSupportAcceptedDto":{"type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"]},"ConfirmMarketingEmailDto":{"type":"object","properties":{"token":{"type":"string","description":"Raw confirmation token from the email link"}},"required":["token"]},"ConfirmMarketingEmailResponseDto":{"type":"object","properties":{"status":{"type":"string","enum":["CONFIRMED","ALREADY_CONFIRMED","INVALID_OR_EXPIRED"]},"message":{"type":"string"},"email":{"type":"string"}},"required":["status","message"]},"MarketingAttributionDto":{"type":"object","properties":{}},"CreatePublicInquiryDto":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"email":{"type":"string"},"country":{"type":"string"},"phoneNumber":{"type":"string"},"inquiryType":{"type":"string"},"message":{"type":"string"},"website":{"type":"string"},"source":{"type":"string"},"mode":{"type":"string","enum":["demo","contact"]},"pageUrl":{"type":"string"},"referrer":{"type":"string"},"annualRevenueBand":{"type":"string"},"contractorType":{"type":"string"},"qboVersion":{"type":"string"},"monthlyInvoiceVolume":{"type":"string"},"activeProjects":{"type":"string"},"apTeamSize":{"type":"string"},"waiverProcess":{"type":"string"},"primaryPain":{"type":"string"},"heardAbout":{"type":"string","description":"Self-reported \"How did you hear about us?\" slug (e.g. ai_assistant)."},"aiReferrer":{"type":"string","description":"AI assistant that referred the visitor (chatgpt, perplexity, gemini, ...)."},"firstTouch":{"$ref":"#/components/schemas/MarketingAttributionDto"},"lastTouch":{"$ref":"#/components/schemas/MarketingAttributionDto"}},"required":["firstName","lastName","company","email","message"]},"CreatePartnerDto":{"type":"object","properties":{}},"UpdatePartnerDto":{"type":"object","properties":{}},"RegisterDealDto":{"type":"object","properties":{}},"DecideDealDto":{"type":"object","properties":{}},"QuickBooksAuthUrlResponse":{"type":"object","properties":{"authUrl":{"type":"string","description":"OAuth authorization URL to redirect user to"},"state":{"type":"string","description":"State parameter for CSRF validation"},"codeVerifier":{"type":"string","description":"PKCE code verifier (store in sessionStorage for callback)"}},"required":["authUrl","state"]},"QuickBooksCallbackDto":{"type":"object","properties":{"code":{"type":"string","description":"Authorization code from QuickBooks OAuth"},"realmId":{"type":"string","description":"QuickBooks company/realm ID"},"state":{"type":"string","description":"State parameter for CSRF validation"},"codeVerifier":{"type":"string","description":"PKCE code verifier for token exchange"}},"required":["code","realmId","state"]},"QuickBooksOAuthSuccessResponse":{"type":"object","properties":{"integrationId":{"type":"string","description":"Integration ID"},"realmId":{"type":"string","description":"QuickBooks company/realm ID"},"status":{"type":"string","description":"Connection status"},"message":{"type":"string","description":"Success message"}},"required":["integrationId","realmId","status","message"]},"QuickBooksConnectionResponse":{"type":"object","properties":{"id":{"type":"string","description":"QuickBooks connection ID"},"integrationId":{"type":"string","description":"Integration ID"},"realmId":{"type":"string","description":"QuickBooks company/realm ID"},"companyName":{"type":"string","description":"QuickBooks company name"},"baseCurrency":{"type":"string","description":"QuickBooks base/home currency code"},"status":{"type":"string","description":"Connection status"},"environment":{"type":"string","description":"Environment (sandbox or production)"},"lastSyncedAt":{"type":"string","description":"Last successful sync timestamp"},"syncStartDate":{"type":"string","description":"Earliest QuickBooks transaction date imported after reset"},"syncStatus":{"type":"string","description":"Current sync status"},"lastSyncError":{"type":"string","description":"Last sync error message if any"},"createdAt":{"type":"string","description":"Connection created timestamp"}},"required":["id","integrationId","realmId","status","environment","createdAt"]},"QuickBooksSyncStatusResponse":{"type":"object","properties":{"syncStatus":{"type":"string","description":"Current sync status"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"lastSyncError":{"type":"string","description":"Last sync error message"},"entityStats":{"type":"object","description":"Entity sync statistics"}},"required":["syncStatus","entityStats"]},"QuickBooksTriggerSyncDto":{"type":"object","properties":{"entityTypes":{"type":"array","description":"Entity types to sync (default: ALL)","items":{"type":"string","enum":["VENDOR","BILL","PURCHASE_ORDER","EXPENSE","JOURNAL_ENTRY","BILL_PAYMENT","ALL"]}},"fullSync":{"type":"boolean","description":"Force full sync instead of delta sync"},"realmId":{"type":"string","description":"QuickBooks realm ID to sync (for multi-company support)"}}},"QuickBooksTriggerSyncResponse":{"type":"object","properties":{"syncJobId":{"type":"string","description":"Sync job ID"},"queuedAt":{"type":"string","description":"Sync queued timestamp"},"status":{"type":"string","description":"Sync status"}},"required":["syncJobId","queuedAt","status"]},"ResetQuickBooksConnectionRequest":{"type":"object","properties":{"resetScope":{"type":"string","enum":["TENANT_OPERATIONAL","CUSTOMER_WORKSPACE"]},"syncStartDate":{"type":"string","description":"Earliest QuickBooks transaction date to sync after reset.","example":"2026-04-27"},"confirmText":{"type":"string","description":"Safety confirmation text, e.g. RESET Company Name."}},"required":["resetScope","syncStartDate","confirmText"]},"QuickBooksResetResponse":{"type":"object","properties":{"connectionId":{"type":"string"},"resetScope":{"type":"string","enum":["TENANT_OPERATIONAL","CUSTOMER_WORKSPACE"]},"syncStartDate":{"type":"string","format":"date","example":"2026-04-27"},"archivedDocuments":{"type":"number"},"archivedPurchaseOrders":{"type":"number"},"deletedMatches":{"type":"number"},"deletedFundAllocations":{"type":"number"},"deletedNotifications":{"type":"number"},"resetJobId":{"type":"string","description":"Background reset task ID."},"status":{"type":"string","description":"Reset request status."},"queuedSyncJobId":{"type":"string"},"queuedSyncJobIds":{"type":"array","items":{"type":"string"}}},"required":["connectionId","resetScope","syncStartDate","archivedDocuments","archivedPurchaseOrders","deletedMatches","deletedFundAllocations","deletedNotifications","queuedSyncJobId","queuedSyncJobIds"]},"QuickBooksResetStatusResponse":{"type":"object","properties":{"resetJobId":{"type":"string"},"status":{"type":"string","enum":["QUEUED","RUNNING","RESYNCING","COMPLETED","FAILED"]},"taskStatus":{"type":"string","description":"Underlying async task status."},"connectionId":{"type":"string","description":"QuickBooks connection ID being reset."},"syncStatus":{"type":"string","description":"Current QuickBooks sync status."},"errorMessage":{"type":"string","description":"Reset or recovery sync error."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"doneAt":{"type":"string"}},"required":["resetJobId","status","taskStatus","createdAt","updatedAt"]},"DisconnectQuickBooksDto":{"type":"object","properties":{"wipeData":{"type":"boolean","description":"Whether to wipe synced data on disconnect"}}},"FundSummaryItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["UNRESTRICTED","TEMPORARILY_RESTRICTED","PERMANENTLY_RESTRICTED"]},"balance":{"type":"number"},"activity":{"type":"number"},"asOfDate":{"format":"date-time","type":"string"}},"required":["id","name","type","balance","activity"]},"FundSummaryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FundSummaryItem"}}},"required":["data"]},"FundResponse":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"type":{"type":"string","enum":["UNRESTRICTED","TEMPORARILY_RESTRICTED","PERMANENTLY_RESTRICTED"]},"parentFundId":{"type":"string"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","tenantId","name","type","isActive","createdAt","updatedAt"]},"FundListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FundResponse"}}},"required":["data"]},"FundCreateRequest":{"type":"object","properties":{"name":{"type":"string","description":"Fund name"},"code":{"type":"string","description":"Optional fund code"},"type":{"type":"string","enum":["UNRESTRICTED","TEMPORARILY_RESTRICTED","PERMANENTLY_RESTRICTED"]},"parentFundId":{"type":"string","description":"Parent fund ID (for hierarchy)"},"isActive":{"type":"boolean","description":"Whether fund is active"}},"required":["name","type"]},"FundUpdateRequest":{"type":"object","properties":{"name":{"type":"string","description":"Fund name"},"code":{"type":"string","description":"Optional fund code"},"type":{"type":"string","enum":["UNRESTRICTED","TEMPORARILY_RESTRICTED","PERMANENTLY_RESTRICTED"]},"parentFundId":{"type":"string","description":"Parent fund ID (for hierarchy)"},"isActive":{"type":"boolean","description":"Whether fund is active"}}},"FundAllocationResponse":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"fundId":{"type":"string"},"sourceType":{"type":"string","enum":["QBO_BILL","QBO_EXPENSE","QBO_JOURNAL","QBO_BILL_PAYMENT","MANUAL"]},"sourceId":{"type":"string"},"qboEntityId":{"type":"string"},"amount":{"type":"string"},"percentage":{"type":"string"},"memo":{"type":"string"},"postedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","tenantId","fundId","sourceType","amount","createdAt","updatedAt"]},"FundAllocationListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FundAllocationResponse"}}},"required":["data"]},"FundAllocationSyncRequest":{"type":"object","properties":{"fullSync":{"type":"boolean","description":"Force full sync"}}},"FundSettingsResponse":{"type":"object","properties":{"accountingBasis":{"type":"string","enum":["ACCRUAL","CASH","BOTH"]}},"required":["accountingBasis"]},"FundSettingsEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FundSettingsResponse"}},"required":["data"]},"FundSettingsUpdateRequest":{"type":"object","properties":{"accountingBasis":{"type":"string","enum":["ACCRUAL","CASH","BOTH"]}},"required":["accountingBasis"]},"FundRuleResponse":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"fundId":{"type":"string"},"matcherType":{"type":"string","enum":["VENDOR","CLASS","DESCRIPTION","ACCOUNT"]},"matchValue":{"type":"string"},"priority":{"type":"number"},"isActive":{"type":"boolean"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","tenantId","fundId","matcherType","matchValue","priority","isActive","createdAt","updatedAt"]},"FundRuleListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FundRuleResponse"}}},"required":["data"]},"FundRuleCreateRequest":{"type":"object","properties":{"fundId":{"type":"string","description":"Fund ID to assign the rule to"},"matcherType":{"type":"string","enum":["VENDOR","CLASS","DESCRIPTION","ACCOUNT"]},"matchValue":{"type":"string","description":"Match value (vendor, class, description, or account)"},"priority":{"type":"number","description":"Priority (higher wins)"},"isActive":{"type":"boolean","description":"Whether the rule is active"}},"required":["fundId","matcherType","matchValue"]},"GrantSummaryItem":{"type":"object","properties":{"id":{"type":"string"},"fundName":{"type":"string"},"funder":{"type":"string"},"amount":{"type":"number"},"spent":{"type":"number"},"nextReportDue":{"format":"date-time","type":"string"},"status":{"type":"string","enum":["ACTIVE","CLOSED","PENDING","ON_HOLD"]}},"required":["id","fundName","funder","amount","spent","status"]},"GrantSummaryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GrantSummaryItem"}}},"required":["data"]},"GrantResponse":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"fundId":{"type":"string"},"funder":{"type":"string"},"amount":{"type":"string"},"currency":{"type":"string"},"startsAt":{"format":"date-time","type":"string"},"endsAt":{"format":"date-time","type":"string"},"restrictions":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","CLOSED","PENDING","ON_HOLD"]},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","tenantId","fundId","funder","amount","status","createdAt","updatedAt"]},"GrantListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GrantResponse"}}},"required":["data"]},"GrantCreateRequest":{"type":"object","properties":{"fundId":{"type":"string","description":"Associated fund ID"},"funder":{"type":"string","description":"Funder name"},"amount":{"type":"number","description":"Grant award amount"},"currency":{"type":"string","description":"Currency code (default USD)"},"startsAt":{"type":"string","description":"Grant start date"},"endsAt":{"type":"string","description":"Grant end date"},"restrictions":{"type":"string","description":"Grant restrictions"},"status":{"type":"string","enum":["ACTIVE","CLOSED","PENDING","ON_HOLD"]}},"required":["fundId","funder","amount"]},"GrantUpdateRequest":{"type":"object","properties":{"fundId":{"type":"string","description":"Associated fund ID"},"funder":{"type":"string","description":"Funder name"},"amount":{"type":"number","description":"Grant award amount"},"currency":{"type":"string","description":"Currency code (default USD)"},"startsAt":{"type":"string","description":"Grant start date"},"endsAt":{"type":"string","description":"Grant end date"},"restrictions":{"type":"string","description":"Grant restrictions"},"status":{"type":"string","enum":["ACTIVE","CLOSED","PENDING","ON_HOLD"]}}},"GrantBudgetLineResponse":{"type":"object","properties":{"id":{"type":"string"},"grantId":{"type":"string"},"category":{"type":"string"},"budgetAmount":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","grantId","category","budgetAmount","createdAt","updatedAt"]},"GrantBudgetLineListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GrantBudgetLineResponse"}}},"required":["data"]},"GrantBudgetLineCreateRequest":{"type":"object","properties":{"category":{"type":"string","description":"Budget category"},"budgetAmount":{"type":"number","description":"Budget amount"}},"required":["category","budgetAmount"]},"GrantReminderResponse":{"type":"object","properties":{"id":{"type":"string"},"grantId":{"type":"string"},"dueDate":{"format":"date-time","type":"string"},"type":{"type":"string","enum":["REPORTING","RENEWAL","OTHER"]},"status":{"type":"string","enum":["PENDING","COMPLETED","DISMISSED"]},"notes":{"type":"string"},"sentAt":{"format":"date-time","type":"string","description":"When the reminder email was sent (null until sent)","nullable":true},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","grantId","dueDate","type","status","createdAt","updatedAt"]},"GrantReminderListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GrantReminderResponse"}}},"required":["data"]},"GrantReminderCreateRequest":{"type":"object","properties":{"dueDate":{"type":"string","description":"Reminder due date","format":"date-time"},"type":{"type":"string","enum":["REPORTING","RENEWAL","OTHER"]},"status":{"type":"string","enum":["PENDING","COMPLETED","DISMISSED"]},"notes":{"type":"string","description":"Notes"}},"required":["dueDate","type"]},"GrantActualAllocationResponse":{"type":"object","properties":{"id":{"type":"string"},"fundId":{"type":"string"},"amount":{"type":"string"},"memo":{"type":"string"},"postedAt":{"format":"date-time","type":"string"}},"required":["id","fundId","amount"]},"GrantActualLineResponse":{"type":"object","properties":{"id":{"type":"string"},"grantId":{"type":"string"},"allocationId":{"type":"string"},"actualAmount":{"type":"string"},"postedAt":{"format":"date-time","type":"string"},"allocation":{"$ref":"#/components/schemas/GrantActualAllocationResponse"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","grantId","actualAmount","createdAt","updatedAt"]},"GrantActualLineListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GrantActualLineResponse"}}},"required":["data"]},"GrantActualLineCreateRequest":{"type":"object","properties":{"allocationId":{"type":"string","description":"Linked fund allocation ID"},"actualAmount":{"type":"number","description":"Actual amount"},"postedAt":{"type":"string","description":"Posted date","format":"date-time"}},"required":["actualAmount"]},"ChartOfAccountEntryResponse":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"department":{"type":"string"},"costCenter":{"type":"string"},"type":{"type":"string","enum":["ASSET","LIABILITY","EXPENSE","REVENUE","EQUITY"]},"active":{"type":"boolean"},"erpId":{"type":"string"},"lastSyncedAt":{"type":"string","format":"date-time"},"source":{"type":"string","enum":["ERP_SYNC","MANUAL","CSV_IMPORT","LEARNED"]}},"required":["id","code","name","type","active","erpId","source"]},"ChartOfAccountListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChartOfAccountEntryResponse"}}},"required":["data"]},"CreateChartOfAccountRequest":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ASSET","LIABILITY","EXPENSE","REVENUE","EQUITY"]},"department":{"type":"string"},"costCenter":{"type":"string"}},"required":["code","name"]},"UpdateChartOfAccountRequest":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ASSET","LIABILITY","EXPENSE","REVENUE","EQUITY"]},"department":{"type":"string"},"costCenter":{"type":"string"},"active":{"type":"boolean"}}},"SyncChartOfAccountsResponse":{"type":"object","properties":{"syncedCount":{"type":"number"},"skippedCount":{"type":"number"},"source":{"type":"string"},"syncedAt":{"type":"string","format":"date-time"}},"required":["syncedCount","source","syncedAt"]},"RejectRecommendationDto":{"type":"object","properties":{}},"CreateLienWaiverDto":{"type":"object","properties":{}},"UpdateLienWaiverSettingsDto":{"type":"object","properties":{}},"OverrideWaiverRequirementDto":{"type":"object","properties":{}},"UpdateLienWaiverDto":{"type":"object","properties":{}},"VerifyLienWaiverDto":{"type":"object","properties":{}},"RejectLienWaiverDto":{"type":"object","properties":{}},"SubmitSubInvoiceDto":{"type":"object","properties":{}},"UploadSubLienWaiverDto":{"type":"object","properties":{}},"UploadSubCoiDto":{"type":"object","properties":{}},"SubmitSubW9Dto":{"type":"object","properties":{}},"AcknowledgeChangeOrderDto":{"type":"object","properties":{}},"SignSubLienWaiverDto":{"type":"object","properties":{}},"CreatePortalLinkDto":{"type":"object","properties":{}},"FoundationImportDto":{"type":"object","properties":{"vendorsCsv":{"type":"string","description":"FOUNDATION vendor list export (CSV text)"},"accountsCsv":{"type":"string","description":"FOUNDATION GL account list export (CSV text)"},"jobsCsv":{"type":"string","description":"FOUNDATION job list export (CSV text)"},"costCodesCsv":{"type":"string","description":"FOUNDATION cost code list export (CSV text)"}}},"FoundationSectionResultResponse":{"type":"object","properties":{"synced":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"alreadyAcknowledged":{"type":"number","description":"Documents skipped because a prior push was already acknowledged by the provider."},"errors":{"type":"array","items":{"type":"string"}},"unchanged":{"type":"number","description":"Rows identical to the stored record (not written)."},"duplicateRowsInFile":{"type":"number","description":"Rows dropped because the same key appeared earlier in the file."}},"required":["synced","created","updated","errors"]},"FoundationImportResponse":{"type":"object","properties":{"vendors":{"$ref":"#/components/schemas/FoundationSectionResultResponse"},"accounts":{"$ref":"#/components/schemas/FoundationSectionResultResponse"},"jobs":{"$ref":"#/components/schemas/FoundationSectionResultResponse"},"costCodes":{"$ref":"#/components/schemas/FoundationSectionResultResponse"}}},"PushPayablesDto":{"type":"object","properties":{"documentIds":{"description":"Array of Aequo document IDs to push as payables","example":["cuid1","cuid2"],"type":"array","items":{"type":"string"}}},"required":["documentIds"]},"FoundationExportResponse":{"type":"object","properties":{"batchId":{"type":"string","nullable":true,"description":"Hand-off batch recorded for this file (null when nothing was exportable). Confirm or void it under /erp-connector/foundation/file-exchange/batches."},"filename":{"type":"string"},"csv":{"type":"string","description":"AP-invoice import file content (CSV text)"},"rowCount":{"type":"number"},"documentCount":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["filename","csv","rowCount","documentCount","errors"]},"ListProvidersResponse":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"string"}}},"required":["providers"]},"ConnectorCapabilitiesDto":{"type":"object","properties":{"authentication":{"type":"string","enum":["NOT_STARTED","DISCOVERY","IN_DEVELOPMENT","TRIAL","PRODUCTION"]},"bootstrapImport":{"type":"string","enum":["NOT_STARTED","DISCOVERY","IN_DEVELOPMENT","TRIAL","PRODUCTION"]},"incrementalSync":{"type":"string","enum":["NOT_STARTED","DISCOVERY","IN_DEVELOPMENT","TRIAL","PRODUCTION"]},"invoiceWriteback":{"type":"string","enum":["NOT_STARTED","DISCOVERY","IN_DEVELOPMENT","TRIAL","PRODUCTION"]},"reconciliation":{"type":"string","enum":["NOT_STARTED","DISCOVERY","IN_DEVELOPMENT","TRIAL","PRODUCTION"]},"supportTooling":{"type":"string","enum":["NOT_STARTED","DISCOVERY","IN_DEVELOPMENT","TRIAL","PRODUCTION"]}},"required":["authentication","bootstrapImport","incrementalSync","invoiceWriteback","reconciliation","supportTooling"]},"ConnectorReadinessDto":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"capabilities":{"$ref":"#/components/schemas/ConnectorCapabilitiesDto"},"marketingReady":{"type":"boolean","description":"Derived — true only when every capability is PRODUCTION. Marketing may claim a live integration only for marketing-ready connectors."},"marketingClaim":{"type":"string","enum":["LIVE","EARLY_ACCESS","NONE"],"description":"Public availability claim: LIVE (marketing-ready), EARLY_ACCESS (offered to selected teams, never called live) or NONE (in development)."},"notes":{"type":"string"}},"required":["slug","name","capabilities","marketingReady","marketingClaim","notes"]},"ConnectorReadinessResponse":{"type":"object","properties":{"connectors":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorReadinessDto"}}},"required":["connectors"]},"TestConnectionDto":{"type":"object","properties":{"provider":{"type":"string","description":"Provider name, e.g. \"procore\""},"config":{"type":"object","description":"Provider-specific connection configuration","example":{"clientId":"...","clientSecret":"...","baseUrl":"..."}}},"required":["provider","config"]},"TestConnectionResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success"]},"ConnectorStatusResponse":{"type":"object","properties":{"configured":{"type":"boolean"},"isActive":{"type":"boolean"},"lastTestedAt":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string","nullable":true},"settings":{"type":"object","additionalProperties":{"type":"string"},"description":"Saved values of the connector's non-secret settingsFields only (e.g. Procore projectId / companyId). Never credentials."},"connectionMode":{"type":"string","enum":["user","service_account"],"nullable":true,"description":"Procore only: whether the connection authenticates as a signed-in user or as the Aequo Build service account."}},"required":["configured","isActive","settings"]},"ErpSyncResultResponse":{"type":"object","properties":{"synced":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"alreadyAcknowledged":{"type":"number","description":"Documents skipped because a prior push was already acknowledged by the provider."},"errors":{"type":"array","items":{"type":"string"}}},"required":["synced","created","updated","errors"]},"CatalogSectionResultResponse":{"type":"object","properties":{"synced":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"alreadyAcknowledged":{"type":"number","description":"Documents skipped because a prior push was already acknowledged by the provider."},"errors":{"type":"array","items":{"type":"string"}},"unchanged":{"type":"number","description":"Rows identical to the stored record (not written)."}},"required":["synced","created","updated","errors"]},"ErpJobCatalogSyncResponse":{"type":"object","properties":{"jobs":{"nullable":true,"description":"Projects/jobs upserted into Build jobs (matched on the ERP external id). Null when not part of this sync.","type":"object","allOf":[{"$ref":"#/components/schemas/CatalogSectionResultResponse"}]},"costCodes":{"nullable":true,"description":"Cost codes merged into the tenant-wide Build cost-code catalog (matched on code). Null when not part of this sync.","type":"object","allOf":[{"$ref":"#/components/schemas/CatalogSectionResultResponse"}]}}},"ProcoreAuthorizeUrlResponse":{"type":"object","properties":{"url":{"type":"string","description":"Procore consent-screen URL to redirect the user to."},"state":{"type":"string","description":"Signed single-use state embedded in the URL."}},"required":["url","state"]},"ProcoreConnectionSummaryResponse":{"type":"object","properties":{"configured":{"type":"boolean"},"isActive":{"type":"boolean"},"connectionMode":{"type":"string","enum":["user","service_account"],"nullable":true,"description":"'user' = signed-in Procore user's OAuth token; 'service_account' = Aequo Build's Developer Managed Service Account (client credentials)."},"companyId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"userAuthLinked":{"type":"boolean","description":"A user-level Procore sign-in is stored. Required to link a service account (it proves your Procore user belongs to the company)."},"serviceAccountAvailable":{"type":"boolean","description":"The server has the Procore app credentials service-account mode needs."}},"required":["configured","isActive","userAuthLinked","serviceAccountAvailable"]},"ProcoreServiceAccountConnectDto":{"type":"object","properties":{"companyId":{"type":"string","description":"Procore company id to link (shown in Procore company URLs). The Aequo Build app must be installed for this company.","example":"1234567"},"projectId":{"type":"string","description":"Procore project id cost codes are read from. Must be one of the projects granted to the app in App Management. Omit to keep the saved project."}},"required":["companyId"]},"FileExchangeBatchDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string","description":"EXPORTED | CONFIRMED | VOIDED (Yardi adds PENDING | FAILED)"},"fileName":{"type":"string"},"rowCount":{"type":"number"},"documentCount":{"type":"number"},"awaitingCount":{"type":"number","description":"Documents still awaiting import confirmation."},"exportedAt":{"type":"string","nullable":true},"confirmedAt":{"type":"string","nullable":true},"voidedAt":{"type":"string","nullable":true},"voidReason":{"type":"string","nullable":true}},"required":["id","provider","status","fileName","rowCount","documentCount","awaitingCount"]},"FileExchangeBatchListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FileExchangeBatchDto"}}},"required":["data"]},"FileExchangeBatchFileResponse":{"type":"object","properties":{"fileName":{"type":"string"},"content":{"type":"string","description":"The exact file content handed off (CSV)."}},"required":["fileName","content"]},"ConfirmHandoffDto":{"type":"object","properties":{"documentIds":{"description":"Confirm only these documents of the batch. Default: every document still awaiting confirmation.","type":"array","items":{"type":"string"}}}},"HandoffActionResponse":{"type":"object","properties":{"batchId":{"type":"string"},"status":{"type":"string","description":"Batch status after the action."},"affectedDocumentIds":{"type":"array","items":{"type":"string"}},"skippedDocumentIds":{"description":"Requested documents that were not in a state the action applies to.","type":"array","items":{"type":"string"}}},"required":["batchId","status","affectedDocumentIds","skippedDocumentIds"]},"VoidHandoffDto":{"type":"object","properties":{"reason":{"type":"string","description":"Why the hand-off is being voided (audit trail)."},"documentIds":{"description":"Release only these documents. Default: every document still awaiting confirmation.","type":"array","items":{"type":"string"}},"confirmNotImported":{"type":"boolean","description":"Required once a file has left Aequo (EXPORTED, or a Yardi batch that failed during upload / is stuck PENDING): the operator asserts the file was NOT imported into the target system, so re-exporting cannot double-post."}},"required":["reason"]},"FileExchangeColumnMappingDto":{"type":"object","properties":{"vendorColumn":{"type":"string","description":"Exact header of the vendor column in the results file (case and punctuation insensitive). Defaults to the first of: vendor name, vendor, vendor id, vendor code, vendor identifier, payee, payee name."},"invoiceNumberColumn":{"type":"string","description":"Exact header of the invoice-number column. Defaults to the first of: invoice number, invoice no, invoice num, invoice, inv no, inv number, invoice id."},"amountColumn":{"type":"string","description":"Exact header of the amount column. Defaults to the first of: amount, invoice amount, total amount, invoice total, total, gross amount."},"delimiter":{"type":"string","description":"Field delimiter: ',' (default), tab, ';' or '|'.","enum":[",","\t",";","|"]}}},"ImportResultsFileDto":{"type":"object","properties":{"csv":{"type":"string","description":"The target system's posted-invoices / AP register export, as CSV text."},"fileName":{"type":"string","description":"Original file name, for the audit trail."},"columnMapping":{"$ref":"#/components/schemas/FileExchangeColumnMappingDto"},"amountTolerance":{"type":"number","description":"Absolute amount tolerance per invoice (default 0.01). Amounts compare by absolute value.","default":0.01},"ignoreVendor":{"type":"boolean","description":"Match on invoice number + amount only — for files whose vendor column carries target-system vendor codes Aequo does not know. Invoice numbers handed off for more than one document are then reported, never guessed."},"batchIds":{"description":"Restrict to these batches (EXPORTED or CONFIRMED). Default: every batch still awaiting confirmation.","type":"array","items":{"type":"string"}}},"required":["csv"]},"ResolvedResultsColumnsDto":{"type":"object","properties":{"vendor":{"type":"string","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true}}},"DocumentReconciliationDto":{"type":"object","properties":{"batchId":{"type":"string"},"documentId":{"type":"string"},"status":{"type":"string","enum":["MATCHED","MISSING","AMOUNT_MISMATCH"]},"detail":{"type":"string"},"matchedRowNumbers":{"type":"array","items":{"type":"number"}}},"required":["batchId","documentId","status","detail","matchedRowNumbers"]},"UnmatchedResultsRowDto":{"type":"object","properties":{"rowNumber":{"type":"number"},"vendor":{"type":"string"},"invoiceNumber":{"type":"string"},"amount":{"type":"number"}},"required":["rowNumber","vendor","invoiceNumber","amount"]},"ImportResultsResponse":{"type":"object","properties":{"importResultId":{"type":"string"},"rowCount":{"type":"number"},"matchedCount":{"type":"number"},"missingCount":{"type":"number"},"amountMismatchCount":{"type":"number"},"unmatchedRowCount":{"type":"number","description":"File rows that matched no handed-off document (e.g. invoices keyed directly in the target system)."},"resolvedColumns":{"$ref":"#/components/schemas/ResolvedResultsColumnsDto"},"rowErrors":{"type":"array","items":{"type":"string"}},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentReconciliationDto"}},"unmatchedRowSamples":{"type":"array","items":{"$ref":"#/components/schemas/UnmatchedResultsRowDto"}},"acknowledgedDocumentIds":{"description":"Documents acknowledged by this upload (MATCHED while awaiting confirmation).","type":"array","items":{"type":"string"}}},"required":["importResultId","rowCount","matchedCount","missingCount","amountMismatchCount","unmatchedRowCount","resolvedColumns","rowErrors","documents","unmatchedRowSamples","acknowledgedDocumentIds"]},"AwaitingDocumentDto":{"type":"object","properties":{"batchId":{"type":"string"},"documentId":{"type":"string"},"invoiceNumber":{"type":"string","nullable":true},"vendorName":{"type":"string","nullable":true},"amount":{"type":"number"},"exportedAt":{"type":"string","nullable":true},"reconciliationStatus":{"type":"string","nullable":true}},"required":["batchId","documentId","amount"]},"LastImportResultDto":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"fileName":{"type":"string","nullable":true},"rowCount":{"type":"number"},"matchedCount":{"type":"number"},"missingCount":{"type":"number"},"amountMismatchCount":{"type":"number"},"unmatchedRowCount":{"type":"number"}},"required":["id","createdAt","rowCount","matchedCount","missingCount","amountMismatchCount","unmatchedRowCount"]},"FileExchangeFindingDto":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["INFO","WARN","ERROR"]},"message":{"type":"string"},"batchId":{"type":"string"},"documentId":{"type":"string"}},"required":["code","severity","message"]},"FileExchangeDiagnosticsResponse":{"type":"object","properties":{"provider":{"type":"string"},"generatedAt":{"type":"string"},"batchesByStatus":{"type":"object","description":"Batch counts by status.","additionalProperties":{"type":"number"}},"awaitingDocumentCount":{"type":"number"},"awaitingDocuments":{"description":"Oldest first, capped at 100.","type":"array","items":{"$ref":"#/components/schemas/AwaitingDocumentDto"}},"lastImportResult":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/LastImportResultDto"}]},"findings":{"type":"array","items":{"$ref":"#/components/schemas/FileExchangeFindingDto"}}},"required":["provider","generatedAt","batchesByStatus","awaitingDocumentCount","awaitingDocuments","findings"]},"CreateReinsurancePremiumStatementDto":{"type":"object","properties":{}},"UpdateReinsurancePremiumStatementDto":{"type":"object","properties":{}},"CreateBrokerCommissionStatementDto":{"type":"object","properties":{}},"UpdateBrokerCommissionStatementDto":{"type":"object","properties":{}},"WorkflowAutomationRuleDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"triggerType":{"type":"string","description":"Event trigger type, e.g. EXCEPTION_CREATED."},"conditions":{"type":"object"},"actions":{"type":"object"},"isEnabled":{"type":"boolean"},"runOrder":{"type":"number","minimum":1,"maximum":999},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","triggerType","isEnabled","runOrder","updatedAt"]},"WorkflowAutomationRuleListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowAutomationRuleDto"}}},"required":["data"]},"CreateWorkflowAutomationRuleDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"triggerType":{"type":"string","description":"Trigger event type."},"conditions":{"type":"object"},"actions":{"type":"object"},"isEnabled":{"type":"boolean","default":true},"runOrder":{"type":"number","minimum":1,"maximum":999,"default":100}},"required":["name","triggerType"]},"UpdateWorkflowAutomationRuleDto":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"triggerType":{"type":"string","description":"Trigger event type."},"conditions":{"type":"object"},"actions":{"type":"object"},"isEnabled":{"type":"boolean"},"runOrder":{"type":"number","minimum":1,"maximum":999}}},"ApprovalDelegationDto":{"type":"object","properties":{"id":{"type":"string"},"delegatorId":{"type":"string"},"delegateId":{"type":"string"},"delegatorName":{"type":"string"},"delegateName":{"type":"string"},"delegatorEmail":{"type":"string"},"delegateEmail":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"endDate":{"type":"string","format":"date-time"},"active":{"type":"boolean"},"status":{"type":"string","enum":["ACTIVE","UPCOMING","EXPIRED"]},"createdBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","delegatorId","delegateId","delegatorName","delegateName","startDate","endDate","active","status","createdAt","updatedAt"]},"ApprovalDelegationListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalDelegationDto"}}},"required":["data"]},"CreateApprovalDelegationDto":{"type":"object","properties":{"delegatorId":{"type":"string"},"delegateId":{"type":"string"},"startDate":{"type":"string","format":"date","example":"2026-03-20"},"endDate":{"type":"string","format":"date","example":"2026-03-25"}},"required":["delegatorId","delegateId","startDate","endDate"]},"UpdateApprovalDelegationDto":{"type":"object","properties":{"delegatorId":{"type":"string"},"delegateId":{"type":"string"},"startDate":{"type":"string","format":"date","example":"2026-03-20"},"endDate":{"type":"string","format":"date","example":"2026-03-25"}}},"VendorCodingDefaultGlAccountResponse":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["ASSET","LIABILITY","EXPENSE","REVENUE","EQUITY"]},"active":{"type":"boolean"}},"required":["id","code","name","type","active"]},"VendorCodingDefaultResponse":{"type":"object","properties":{"id":{"type":"string"},"supplierId":{"type":"string"},"supplierName":{"type":"string"},"glAccountId":{"type":"string"},"glAccount":{"$ref":"#/components/schemas/VendorCodingDefaultGlAccountResponse"},"department":{"type":"string"},"costCenter":{"type":"string"},"createdBy":{"type":"string"},"updatedBy":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","supplierId","supplierName","glAccountId","glAccount","createdAt","updatedAt"]},"VendorCodingDefaultListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VendorCodingDefaultResponse"}}},"required":["data"]},"CreateVendorCodingDefaultRequest":{"type":"object","properties":{"supplierId":{"type":"string"},"glAccountId":{"type":"string"},"department":{"type":"string"},"costCenter":{"type":"string"}},"required":["supplierId","glAccountId"]},"UpdateVendorCodingDefaultRequest":{"type":"object","properties":{"glAccountId":{"type":"string"},"department":{"type":"string"},"costCenter":{"type":"string"}}},"PoRequirementRuleResponse":{"type":"object","properties":{"id":{"type":"string"},"supplierId":{"type":"string"},"supplierName":{"type":"string"},"glAccountId":{"type":"string"},"glAccount":{"$ref":"#/components/schemas/VendorCodingDefaultGlAccountResponse"},"department":{"type":"string"},"source":{"type":"string","enum":["QUICKBOOKS","XERO","FRESHBOOKS","ZOHO","ALL"]},"requirement":{"type":"string","enum":["REQUIRED","OPTIONAL"]},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","source","requirement","isActive","createdAt","updatedAt"]},"PoRequirementRuleListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PoRequirementRuleResponse"}}},"required":["data"]},"CreatePoRequirementRuleRequest":{"type":"object","properties":{"supplierId":{"type":"string"},"glAccountId":{"type":"string"},"department":{"type":"string"},"source":{"type":"string","enum":["QUICKBOOKS","XERO","FRESHBOOKS","ZOHO","ALL"]},"requirement":{"type":"string","enum":["REQUIRED","OPTIONAL"]},"isActive":{"type":"boolean"}},"required":["source","requirement"]},"UpdatePoRequirementRuleRequest":{"type":"object","properties":{"supplierId":{"type":"string"},"glAccountId":{"type":"string"},"department":{"type":"string"},"source":{"type":"string","enum":["QUICKBOOKS","XERO","FRESHBOOKS","ZOHO","ALL"]},"requirement":{"type":"string","enum":["REQUIRED","OPTIONAL"]},"isActive":{"type":"boolean"}}},"CodingRuleSettingsResponse":{"type":"object","properties":{"aiSuggestionsEnabled":{"type":"boolean"},"autoDisplayConfidenceThresholdPct":{"type":"number","minimum":0,"maximum":100},"learnFromCorrections":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}},"required":["aiSuggestionsEnabled","autoDisplayConfidenceThresholdPct","learnFromCorrections","updatedAt"]},"UpdateCodingRuleSettingsRequest":{"type":"object","properties":{"aiSuggestionsEnabled":{"type":"boolean"},"autoDisplayConfidenceThresholdPct":{"type":"number","minimum":0,"maximum":100},"learnFromCorrections":{"type":"boolean"}}},"LobConfigDto":{"type":"object","properties":{"id":{"type":"string"},"lob":{"type":"string","description":"Normalized insurance line of business key.","example":"PROPERTY"},"autoMatchThreshold":{"type":"number","description":"Weighted similarity threshold required for auto-approval.","minimum":0,"maximum":1,"example":0.85},"weightFactor":{"type":"number","description":"Multiplier applied to similarity before threshold evaluation.","minimum":0.1,"maximum":5,"example":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastChangedAt":{"type":"string","format":"date-time"},"lastChangedByName":{"type":"string"},"lastChangedByEmail":{"type":"string"}},"required":["id","lob","autoMatchThreshold","weightFactor","createdAt","updatedAt"]},"LobConfigListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LobConfigDto"}}},"required":["data"]},"CreateLobConfigDto":{"type":"object","properties":{"autoMatchThreshold":{"type":"number","description":"Weighted similarity threshold required for auto-approval.","minimum":0,"maximum":1,"example":0.85},"weightFactor":{"type":"number","description":"Multiplier applied to similarity before threshold evaluation.","minimum":0.1,"maximum":5,"example":1},"lob":{"type":"string","description":"Insurance line of business to create or update.","example":"PROPERTY"}},"required":["autoMatchThreshold","weightFactor","lob"]},"UpsertLobConfigDto":{"type":"object","properties":{"autoMatchThreshold":{"type":"number","description":"Weighted similarity threshold required for auto-approval.","minimum":0,"maximum":1,"example":0.85},"weightFactor":{"type":"number","description":"Multiplier applied to similarity before threshold evaluation.","minimum":0.1,"maximum":5,"example":1}},"required":["autoMatchThreshold","weightFactor"]},"FieldCorrectionDto":{"type":"object","properties":{"fieldName":{"type":"string","description":"Name of the extracted field."},"extractedValue":{"type":"string","description":"The value originally extracted by the AI.","nullable":true},"correctedValue":{"type":"string","description":"The value the user corrected it to.","nullable":true}},"required":["fieldName"]},"LogDocumentAccuracyRequestDto":{"type":"object","properties":{"documentId":{"type":"string","description":"ID of the document."},"fields":{"description":"List of field corrections for the document.","type":"array","items":{"$ref":"#/components/schemas/FieldCorrectionDto"}}},"required":["documentId","fields"]},"AccuracyMetricsResponseDto":{"type":"object","properties":{"overallAccuracy":{"type":"number","description":"Overall accuracy percentage."},"totalFields":{"type":"number","description":"Total number of fields evaluated."},"correctFields":{"type":"number","description":"Number of fields that were correct."},"byField":{"type":"object","description":"Accuracy broken down by field name."}},"required":["overallAccuracy","totalFields","correctFields","byField"]},"MonthlyAccuracyPointDto":{"type":"object","properties":{"month":{"type":"string","description":"Month label (YYYY-MM)."},"accuracy":{"type":"number"},"total":{"type":"number"},"correct":{"type":"number"}},"required":["month","accuracy","total","correct"]},"AccuracyTrendResponseDto":{"type":"object","properties":{"trend":{"type":"array","items":{"$ref":"#/components/schemas/MonthlyAccuracyPointDto"}}},"required":["trend"]},"CostAnomalyResponseDto":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"documentId":{"type":"string"},"anomalyType":{"type":"string","enum":["PRICE_SPIKE","PRICE_DROP","DUPLICATE_AMOUNT","UNUSUAL_FREQUENCY","COST_CODE_DEVIATION","NEW_VENDOR_HIGH_VALUE","ROUND_NUMBER"]},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH","CRITICAL"]},"description":{"type":"string"},"expectedValue":{"type":"string"},"actualValue":{"type":"string"},"deviationPct":{"type":"string"},"vendorName":{"type":"string"},"costCodeId":{"type":"string"},"jobId":{"type":"string"},"isResolved":{"type":"boolean"},"resolvedAt":{"type":"string"},"resolvedById":{"type":"string"},"resolvedNote":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","tenantId","documentId","anomalyType","severity","description","isResolved","createdAt","updatedAt"]},"CostAnomalySummaryResponseDto":{"type":"object","properties":{"total":{"type":"number"},"unresolved":{"type":"number"},"bySeverity":{"type":"object"},"byType":{"type":"object"}},"required":["total","unresolved","bySeverity","byType"]},"ResolveCostAnomalyDto":{"type":"object","properties":{"note":{"type":"string","description":"Optional note explaining the resolution"}}},"PurchaseOrderIntegrationCapabilityDTO":{"type":"object","properties":{"supported":{"type":"boolean","description":"Whether this provider supports native purchase orders."},"createSync":{"type":"boolean","description":"Whether Aequo can create purchase orders in this provider."},"updateSync":{"type":"boolean","description":"Whether Aequo can update purchase orders in this provider."},"statusRefresh":{"type":"boolean","description":"Whether Aequo can refresh and show external purchase order status."},"matchWritebackClose":{"type":"boolean","description":"Whether Aequo can close or mark purchase orders billed after match writeback."},"unsupportedReason":{"type":"string","description":"Reason shown when purchase order support is unavailable."}},"required":["supported","createSync","updateSync","statusRefresh","matchWritebackClose"]},"IntegrationCapabilitiesDTO":{"type":"object","properties":{"purchaseOrders":{"description":"Purchase order sync and status capabilities.","allOf":[{"$ref":"#/components/schemas/PurchaseOrderIntegrationCapabilityDTO"}]}},"required":["purchaseOrders"]},"IntegrationDTO":{"type":"object","properties":{"id":{"type":"string","description":"Integration ID","format":"uuid"},"type":{"type":"string","description":"Integration type","enum":["MERGE","SFTP","QUICKBOOKS","XERO","FRESHBOOKS","ZOHO"]},"provider":{"type":"string","description":"Provider name (e.g., \"QuickBooks Online\")"},"status":{"type":"string","description":"Current integration status","enum":["CONNECTED","SYNCING","ERROR","DISCONNECTED"]},"lastSyncedAt":{"type":"string","description":"Last successful sync time","format":"date-time"},"createdAt":{"type":"string","description":"Creation timestamp","format":"date-time"},"errorMessage":{"type":"string","description":"Error message if status is ERROR"},"capabilities":{"description":"Provider capability flags scoped to this integration.","allOf":[{"$ref":"#/components/schemas/IntegrationCapabilitiesDTO"}]}},"required":["id","type","status","createdAt","capabilities"]},"IntegrationListResponse":{"type":"object","properties":{"data":{"description":"List of integrations","type":"array","items":{"$ref":"#/components/schemas/IntegrationDTO"}},"nextCursor":{"type":"string","description":"Pagination cursor for next page"}},"required":["data"]},"MergeLinkTokenRequest":{"type":"object","properties":{"scopes":{"description":"Optional: Scopes to request from Merge","type":"array","items":{"type":"string"}},"integrationId":{"type":"string","description":"Optional: Integration ID if re-linking an existing integration. When provided, quota check is skipped.","format":"uuid"}}},"MergeLinkTokenResponse":{"type":"object","properties":{"linkToken":{"type":"string","description":"Token used for frontend integration with Merge"},"expiresAt":{"type":"string","description":"Expiration time of the link token","format":"date-time"}},"required":["linkToken","expiresAt"]},"ExchangeMergeTokenRequest":{"type":"object","properties":{"publicToken":{"type":"string","description":"Public token returned by Merge Link"},"integrationId":{"type":"string","description":"Integration ID for re-linking existing integration","format":"uuid"}},"required":["publicToken"]},"ExchangeMergeTokenResponse":{"type":"object","properties":{"integrationId":{"type":"string","description":"The integration ID in our system","format":"uuid"},"status":{"type":"string","description":"Integration status","enum":["CONNECTED","SYNCING","ERROR","DISCONNECTED"]},"provider":{"type":"string","description":"Provider name from Merge (e.g., \"QuickBooks Online\")"}},"required":["integrationId","status"]},"ForceSyncResponse":{"type":"object","properties":{"syncJobId":{"type":"string","description":"ID of the sync job"},"queuedAt":{"type":"string","description":"When the sync job was queued","format":"date-time"}},"required":["syncJobId","queuedAt"]},"SyncLogDto":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string","enum":["ACCOUNTING_DATA","CHART_OF_ACCOUNTS","VENDORS","DOCUMENTS"]},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","BIDIRECTIONAL"]},"status":{"type":"string","enum":["QUEUED","RUNNING","SUCCEEDED","FAILED"]},"recordsAttempted":{"type":"number"},"recordsSynced":{"type":"number"},"recordsFailed":{"type":"number"},"errorDetails":{"type":"string"},"queuedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true},"boundary":{"type":"object"}},"required":["id","entityType","direction","status","recordsAttempted","recordsSynced","recordsFailed","queuedAt"]},"IntegrationBoundaryEventDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"source":{"type":"string"},"entityType":{"type":"string"},"externalId":{"type":"string","nullable":true},"operation":{"type":"string","nullable":true},"severity":{"type":"string"},"reasonCode":{"type":"string"},"message":{"type":"string"},"actionTaken":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","provider","source","entityType","severity","reasonCode","message","actionTaken","createdAt"]},"SyncHealthResponseDto":{"type":"object","properties":{"integrationId":{"type":"string"},"lastSyncTriggeredAt":{"type":"string","format":"date-time","nullable":true},"lastSyncedAt":{"type":"string","format":"date-time","nullable":true},"lastError":{"type":"string","nullable":true},"recentLogs":{"type":"array","items":{"$ref":"#/components/schemas/SyncLogDto"}},"boundarySummary":{"type":"object"},"recentBoundaryEvents":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationBoundaryEventDto"}}},"required":["integrationId","recentLogs","boundarySummary","recentBoundaryEvents"]},"YardiExportMappingConfigDto":{"type":"object","properties":{"entityCodeField":{"type":"string","description":"Document payload field used to resolve the Yardi entity code when no line-level value is present.","example":"entity_code"},"propertyCodeField":{"type":"string","description":"Document payload field used to resolve the Yardi property code when no line-level value is present.","example":"property_code"},"projectCodeField":{"type":"string","description":"Document payload field used to resolve the Yardi job or project code when no line-level value is present.","example":"project_code"},"memoField":{"type":"string","description":"Document payload field used to resolve the invoice memo when no line description is present.","example":"memo"},"defaultEntityCode":{"type":"string","description":"Fallback entity code applied when no mapped value is available on the document or line."},"defaultPropertyCode":{"type":"string","description":"Fallback property code applied when no mapped value is available on the document or line."},"defaultProjectCode":{"type":"string","description":"Fallback project/job code applied when no mapped value is available on the document or line."},"defaultDepartment":{"type":"string","description":"Fallback department applied when coding is missing a department."},"defaultCostCenter":{"type":"string","description":"Fallback cost center applied when coding is missing a cost center."}}},"SftpCredentialsResponse":{"type":"object","properties":{"integrationId":{"type":"string","description":"Integration ID for the SFTP connection"},"host":{"type":"string","description":"SFTP server hostname"},"port":{"type":"number","description":"SFTP server port","example":22},"username":{"type":"string","description":"SFTP username"},"passwordConfigured":{"type":"boolean","description":"Whether a password or API key is already configured"},"provider":{"type":"string","description":"Configured SFTP provider mode","enum":["SFTP","YARDI_VOYAGER"]},"capabilities":{"type":"array","description":"Enabled SFTP capabilities","items":{"type":"string","enum":["INBOUND_DOCUMENTS","YARDI_PAYABLES_OUTBOUND"]}},"supplierId":{"type":"string","description":"Default supplier ID used for SFTP-ingested files"},"configuredAt":{"type":"string","description":"When these credentials were last configured","format":"date-time"},"path":{"type":"string","description":"Upload directory path","example":"/inbox"},"archivePath":{"type":"string","description":"Archive directory path","example":"/inbox/archive"},"errorPath":{"type":"string","description":"Error directory path","example":"/inbox/error"},"outboundPath":{"type":"string","description":"Outbound directory path for Yardi payable exports","example":"/outbound/payables"},"outboundArchivePath":{"type":"string","description":"Archive directory for payable exports","example":"/outbound/payables/archive"},"outboundErrorPath":{"type":"string","description":"Error directory for payable exports","example":"/outbound/payables/error"},"exportTemplateVersion":{"type":"string","description":"Named Yardi export template version","example":"finpayables-v1"},"yardiExportMapping":{"description":"Tenant-scoped Yardi export mapping settings","allOf":[{"$ref":"#/components/schemas/YardiExportMappingConfigDto"}]}},"required":["integrationId","host","username","passwordConfigured","provider","capabilities","path","archivePath","errorPath"]},"UpsertSftpCredentialsRequest":{"type":"object","properties":{"host":{"type":"string","description":"SFTP server hostname or IP"},"port":{"type":"number","description":"SFTP port (defaults to 22 when omitted)","example":22},"username":{"type":"string","description":"SFTP username"},"password":{"type":"string","description":"SFTP password or API key. Omit on update to keep the existing secret."},"provider":{"type":"string","description":"Provider mode for this SFTP connection. Defaults to standard inbound SFTP.","enum":["SFTP","YARDI_VOYAGER"],"default":"SFTP"},"capabilities":{"type":"array","description":"Enabled capabilities for this SFTP connection. Defaults to inbound documents only.","items":{"type":"string","enum":["INBOUND_DOCUMENTS","YARDI_PAYABLES_OUTBOUND"]}},"supplierId":{"type":"string","description":"Default supplier ID assigned to SFTP-ingested files"},"path":{"type":"string","description":"Remote upload directory path (defaults to /inbox)","example":"/incoming/invoices"},"archivePath":{"type":"string","description":"Archive directory for successfully processed files","example":"/incoming/invoices/archive"},"errorPath":{"type":"string","description":"Error directory for files that failed processing","example":"/incoming/invoices/error"},"outboundPath":{"type":"string","description":"Outbound directory used for payable exports when Yardi outbound capability is enabled.","example":"/outbound/payables"},"outboundArchivePath":{"type":"string","description":"Archive directory for successfully exported payable files","example":"/outbound/payables/archive"},"outboundErrorPath":{"type":"string","description":"Error directory for failed payable exports","example":"/outbound/payables/error"},"exportTemplateVersion":{"type":"string","description":"Named export template version used to shape the outbound Yardi payable file.","example":"finpayables-v1"},"yardiExportMapping":{"description":"Tenant-scoped mapping configuration for Yardi payable exports.","allOf":[{"$ref":"#/components/schemas/YardiExportMappingConfigDto"}]}},"required":["host","username"]},"YardiExportBatchResponse":{"type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"},"status":{"type":"string"},"trigger":{"type":"string"},"fileName":{"type":"string"},"remotePath":{"type":"string"},"rowCount":{"type":"number"},"exportedAt":{"type":"string"},"errorMessage":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","integrationId","status","trigger","fileName","remotePath","rowCount","createdAt"]},"YardiExportBatchListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/YardiExportBatchResponse"}}},"required":["data"]},"RunYardiExportResponse":{"type":"object","properties":{"batch":{"description":"Created export batch when a run produced exportable rows.","allOf":[{"$ref":"#/components/schemas/YardiExportBatchResponse"}]},"skippedReason":{"type":"string","description":"Reason the run was skipped when no batch was created."}}},"EmailIngestionSettingsResponse":{"type":"object","properties":{"inboxAddress":{"type":"string","description":"Tenant-specific AP inbox address"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]},"autoProcessAttachments":{"type":"boolean"},"rejectRepliesWithoutAttachments":{"type":"boolean"},"sendConfirmationEmail":{"type":"boolean"},"defaultDocumentType":{"type":"string","enum":["PO","INV","DN"]},"acceptedFileTypes":{"type":"array","items":{"type":"string"}},"lastReceivedAt":{"type":"string","format":"date-time"},"processedToday":{"type":"number"}},"required":["inboxAddress","status","autoProcessAttachments","rejectRepliesWithoutAttachments","sendConfirmationEmail","defaultDocumentType","acceptedFileTypes","processedToday"]},"UpdateEmailIngestionSettingsRequest":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","PAUSED"]},"autoProcessAttachments":{"type":"boolean"},"rejectRepliesWithoutAttachments":{"type":"boolean"},"sendConfirmationEmail":{"type":"boolean"},"defaultDocumentType":{"type":"string","enum":["PO","INV","DN"]},"acceptedFileTypes":{"type":"array","items":{"type":"string"}}}},"EmailIngestionActivityEventResponse":{"type":"object","properties":{"id":{"type":"string"},"inboxAddress":{"type":"string"},"sourceEmail":{"type":"string"},"subject":{"type":"string"},"attachmentCount":{"type":"number"},"processedCount":{"type":"number"},"duplicateCount":{"type":"number"},"rejectedCount":{"type":"number"},"status":{"type":"string","enum":["PROCESSED","PARTIAL","IGNORED","REJECTED","FAILED"]},"message":{"type":"string"},"receivedAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","inboxAddress","attachmentCount","processedCount","duplicateCount","rejectedCount","status","createdAt"]},"EmailIngestionActivityResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailIngestionActivityEventResponse"}}},"required":["data"]},"AccountingPoWritebackIssueDto":{"type":"object","properties":{"severity":{"type":"string"},"reasonCode":{"type":"string"},"message":{"type":"string"},"actionTaken":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["severity","reasonCode","message","actionTaken","createdAt"]},"AccountingPoWritebackSettingDto":{"type":"object","properties":{"integrationId":{"type":"string"},"provider":{"type":"string","enum":["QUICKBOOKS","XERO","FRESHBOOKS","ZOHO"]},"integrationStatus":{"type":"string"},"connectionId":{"type":"string","nullable":true},"connectionName":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["MATCH_CLEARED"]},"supported":{"type":"boolean"},"mode":{"type":"string","enum":["NATIVE_BILL_PO_LINK","PURCHASE_ORDER_CLOSE","BILL_REFERENCE"],"nullable":true},"modeDescription":{"type":"string","nullable":true},"unsupportedReason":{"type":"string","nullable":true},"verificationStatus":{"type":"string","enum":["VERIFIED","NEEDS_SANDBOX_VERIFICATION","REFERENCE_ONLY"]},"verificationMessage":{"type":"string","nullable":true},"needsAttention":{"type":"boolean"},"openIssueCount":{"type":"number"},"lastIssue":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/AccountingPoWritebackIssueDto"}]},"retryAvailable":{"type":"boolean"}},"required":["integrationId","provider","integrationStatus","connectionId","connectionName","enabled","trigger","supported","mode","modeDescription","unsupportedReason","verificationStatus","verificationMessage","needsAttention","openIssueCount","lastIssue","retryAvailable"]},"AccountingPoWritebackSettingsResponseDto":{"type":"object","properties":{"settings":{"type":"array","items":{"$ref":"#/components/schemas/AccountingPoWritebackSettingDto"}}},"required":["settings"]},"UpdateAccountingPoWritebackSettingDto":{"type":"object","properties":{"enabled":{"type":"boolean"},"trigger":{"type":"string","enum":["MATCH_CLEARED"],"default":"MATCH_CLEARED"}},"required":["enabled"]},"RetryAccountingPoWritebackFailuresResponseDto":{"type":"object","properties":{"integrationId":{"type":"string"},"reviewedIssueCount":{"type":"number"},"queuedRetryCount":{"type":"number"}},"required":["integrationId","reviewedIssueCount","queuedRetryCount"]},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string","description":"Success response message"}},"required":["message"]},"MergeWebhookPayload":{"type":"object","properties":{"id":{"type":"string","description":"Unique webhook event ID from Merge (if provided)"},"event":{"type":"string","description":"Merge event type (for example linked_account_linked)"},"event_type":{"type":"string","description":"Alternative event type field from some Merge payloads"},"account_token":{"type":"string","description":"Account token for the linked account"},"linked_account":{"type":"object","description":"Linked account object from Merge"},"data":{"type":"object","description":"Event data payload"}}},"EmailHeaderDto":{"type":"object","properties":{"Name":{"type":"string","description":"Header name"},"Value":{"type":"string","description":"Header value"}},"required":["Name","Value"]},"EmailReplyWebhookPayload":{"type":"object","properties":{"From":{"type":"string","description":"Sender email address"},"FromName":{"type":"string","description":"Sender name"},"FromFull":{"type":"object","description":"Full sender information"},"Subject":{"type":"string","description":"Email subject"},"TextBody":{"type":"string","description":"Plain text body"},"HtmlBody":{"type":"string","description":"HTML body"},"MessageID":{"type":"string","description":"Message ID"},"Date":{"type":"string","description":"Message date"},"To":{"type":"string","description":"Recipient email"},"MessageStream":{"type":"string","description":"Message stream"},"InReplyTo":{"type":"string","description":"Original message ID this email replies to (provider dependent)"},"References":{"type":"string","description":"Message reference chain used for thread matching"},"OriginalMessageID":{"type":"string","description":"Provider-specific original message ID"},"ReplyToMessageID":{"type":"string","description":"Provider-specific reply-to message ID"},"ThreadID":{"type":"string","description":"Provider-specific thread ID"},"Headers":{"description":"Raw email headers from the provider","type":"array","items":{"$ref":"#/components/schemas/EmailHeaderDto"}}},"required":["From","Subject"]},"OnboardingTaskDto":{"type":"object","properties":{"id":{"type":"string","example":"connect_accounting"},"label":{"type":"string","example":"Connect accounting integration"},"description":{"type":"string","example":"Connect QuickBooks or Xero to start syncing finance data."},"href":{"type":"string","example":"/onboarding/connect-accounting"},"completed":{"type":"boolean","example":true},"required":{"type":"boolean","example":true}},"required":["id","label","description","href","completed","required"]},"OnboardingWizardStateResponseDto":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"track":{"type":"string","enum":["SETUP","MEMBER_QUICKSTART"]},"steps":{"type":"array","items":{"type":"string"}},"requiredTaskIds":{"type":"array","items":{"type":"string"}},"completedTaskIds":{"type":"array","items":{"type":"string"}},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingTaskDto"}},"canSeedSampleData":{"type":"boolean","example":true},"sampleDataSeededAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-02-14T14:00:00.000Z"},"onboardingCompletedAt":{"type":"string","format":"date-time","nullable":true,"example":"2026-02-14T14:05:00.000Z"}},"required":["role","track","steps","requiredTaskIds","completedTaskIds","tasks","canSeedSampleData"]},"SeedSampleDataResponseDto":{"type":"object","properties":{"success":{"type":"boolean","example":true},"alreadySeeded":{"type":"boolean","example":false},"createdCounts":{"type":"object","properties":{"suppliers":{"type":"number"},"purchaseOrders":{"type":"number"},"documents":{"type":"number"}}},"message":{"type":"string","example":"Sample data seeded successfully."}},"required":["success","alreadySeeded","createdCounts","message"]},"SelectedServiceInputDto":{"type":"object","properties":{"id":{"type":"string","example":"1","description":"Identifier of the selected service."},"title":{"type":"string","example":"Smart GL Coding","description":"Title of the service."}},"required":["id","title"]},"SubmitServicesRequestDto":{"type":"object","properties":{"services":{"description":"List of services selected by the user.","type":"array","items":{"$ref":"#/components/schemas/SelectedServiceInputDto"}}},"required":["services"]},"OnboardingSuccessResponseDto":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Data saved successfully."}},"required":["success"]},"BillingDetailsResponseDto":{"type":"object","properties":{"customerId":{"type":"string","description":"Customer ID from Stripe"},"defaultPaymentMethod":{"type":"object","description":"Default payment method"},"billingAddress":{"type":"object","description":"Billing address"},"subscription":{"type":"object","description":"Subscription details"}},"required":["customerId","defaultPaymentMethod","billingAddress","subscription"]},"InvoiceDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"created":{"type":"string"},"dueDate":{"type":"string"},"paidAt":{"type":"string"},"hostedInvoiceUrl":{"type":"string"},"invoicePdf":{"type":"string"}},"required":["id","number","status","amount","currency","created","dueDate","paidAt","hostedInvoiceUrl","invoicePdf"]},"InvoiceResponseDto":{"type":"object","properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceDto"}},"hasMore":{"type":"boolean"}},"required":["invoices","hasMore"]},"BillingPortalResponseDto":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"PlanDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"priceId":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"interval":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"isPopular":{"type":"boolean"},"limits":{"type":"object","properties":{"documents":{"type":"number","nullable":true},"seats":{"type":"number","nullable":true},"integrations":{"type":"number","nullable":true}}},"pricing":{"type":"object","properties":{"monthly":{"type":"object","nullable":true,"properties":{"priceId":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"interval":{"type":"string"}}},"annual":{"type":"object","nullable":true,"properties":{"priceId":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"interval":{"type":"string"}}}}},"featureGroups":{"type":"object","properties":{"core":{"type":"array","items":{"type":"string"}},"automation":{"type":"array","items":{"type":"string"}},"support":{"type":"array","items":{"type":"string"}},"integrations":{"type":"array","items":{"type":"string"}}}}},"required":["id","name","description","priceId","amount","currency","interval","features","isPopular","limits","pricing","featureGroups"]},"PlanResponseDto":{"type":"object","properties":{"plans":{"type":"array","items":{"$ref":"#/components/schemas/PlanDto"}},"currentPlanId":{"type":"string"}},"required":["plans","currentPlanId"]},"PlanQuotasDto":{"type":"object","properties":{"docs":{"type":"number","description":"Monthly document limit. Null means unlimited.","nullable":true},"mergeConns":{"type":"number","description":"Merge connection limit. Null means unlimited.","nullable":true},"seats":{"type":"number","description":"User seat limit. Null means unlimited.","nullable":true}},"required":["docs","mergeConns","seats"]},"PlanUsageDto":{"type":"object","properties":{"docsUsed":{"type":"number","description":"Documents used in the current period.","nullable":true},"mergeConnections":{"type":"number","description":"Active Merge connections.","nullable":true},"seatsUsed":{"type":"number","description":"Active user seats used.","nullable":true}},"required":["docsUsed","mergeConnections","seatsUsed"]},"UsageSummaryResponseDto":{"type":"object","properties":{"plan":{"type":"string","description":"Current plan of the tenant.","enum":["FREE","TEAM","GROWTH","SCALE","ENTERPRISE","APPSUMO_T1","APPSUMO_T2","APPSUMO_T3"]},"quotas":{"description":"Quotas for the current plan.","allOf":[{"$ref":"#/components/schemas/PlanQuotasDto"}]},"usage":{"description":"Current usage metrics.","allOf":[{"$ref":"#/components/schemas/PlanUsageDto"}]},"renewalDate":{"type":"string","description":"Next renewal date (YYYY-MM-DD). Null if not applicable (e.g., LTD or Free).","format":"date-only","nullable":true}},"required":["plan","quotas","usage"]},"CreateCheckoutSessionRequestDto":{"type":"object","properties":{"priceId":{"type":"string","description":"Stripe price ID for the selected plan"},"successUrl":{"type":"string","description":"Success URL after payment"},"cancelUrl":{"type":"string","description":"Cancel URL if user cancels payment"}},"required":["priceId"]},"CreateCheckoutSessionResponseDto":{"type":"object","properties":{"checkoutUrl":{"type":"string","description":"Stripe checkout session URL"},"sessionId":{"type":"string","description":"Checkout session ID"}},"required":["checkoutUrl","sessionId"]},"BillingPeriodDto":{"type":"object","properties":{"start":{"type":"string","description":"Start of billing period","format":"date-time"},"end":{"type":"string","description":"End of billing period","format":"date-time"},"daysRemaining":{"type":"number","description":"Days remaining in billing period"}},"required":["start","end","daysRemaining"]},"UsageStatusResponseDto":{"type":"object","properties":{"plan":{"type":"object","description":"Current plan information"},"usage":{"type":"object","description":"Current usage metrics"},"billingPeriod":{"description":"Billing period information (null for free/LTD plans)","allOf":[{"$ref":"#/components/schemas/BillingPeriodDto"}]},"warnings":{"description":"Warning messages for limits approaching capacity","type":"array","items":{"type":"string"}},"features":{"type":"object","description":"Features enabled on current plan"},"canUpgrade":{"type":"boolean","description":"Whether the tenant can upgrade"},"trial":{"type":"object","description":"Trial information if active"}},"required":["plan","usage","warnings","features","canUpgrade"]},"AppSubscriptionResponseDto":{"type":"object","properties":{"appCode":{"type":"string","enum":["QUICKBOOKS","FUND","COLLECT","AP","AR","FINANCE","CLOSE","CONTROLS","AUDIT","TREASURY","RECONCILIATION"]},"planCode":{"type":"string","enum":["APP_FREE","APP_STARTER","APP_PROFESSIONAL","APP_BUSINESS","APP_ENTERPRISE"]},"status":{"type":"string"},"stripeSubscriptionId":{"type":"string"},"currentPeriodEnd":{"type":"string"},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["appCode","planCode","status"]},"AllAppSubscriptionsResponseDto":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/AppSubscriptionResponseDto"}}},"required":["subscriptions"]},"AppPriceDto":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string"},"interval":{"type":"string","enum":["MONTH","YEAR"]},"amountCents":{"type":"number"},"stripeProductId":{"type":"string"},"stripePriceId":{"type":"string"},"lookupKey":{"type":"string"},"isPrimary":{"type":"boolean"}},"required":["id","currency","interval","amountCents","stripeProductId","stripePriceId","isPrimary"]},"AppPlanDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"planCode":{"type":"string","enum":["APP_FREE","APP_STARTER","APP_PROFESSIONAL","APP_BUSINESS","APP_ENTERPRISE"]},"monthlyPriceCents":{"type":"number"},"yearlyPriceCents":{"type":"number"},"stripePriceIdMonthly":{"type":"string"},"stripePriceIdYearly":{"type":"string"},"limits":{"type":"object"},"features":{"type":"object"},"isPopular":{"type":"boolean"},"stripeProductId":{"type":"string"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/AppPriceDto"}},"upsellPlanCode":{"type":"string","enum":["APP_FREE","APP_STARTER","APP_PROFESSIONAL","APP_BUSINESS","APP_ENTERPRISE"]}},"required":["id","name","planCode","monthlyPriceCents","yearlyPriceCents","limits","features","isPopular","prices"]},"AppPlansResponseDto":{"type":"object","properties":{"plans":{"type":"array","items":{"$ref":"#/components/schemas/AppPlanDto"}},"currentPlanCode":{"type":"string","enum":["APP_FREE","APP_STARTER","APP_PROFESSIONAL","APP_BUSINESS","APP_ENTERPRISE"]},"crossSellAppCodes":{"type":"array","items":{"type":"string"}}},"required":["plans"]},"CreateAppCheckoutDto":{"type":"object","properties":{"priceId":{"type":"string","description":"Stripe price ID for the selected app plan"},"planCode":{"type":"string","enum":["APP_FREE","APP_STARTER","APP_PROFESSIONAL","APP_BUSINESS","APP_ENTERPRISE"],"description":"Plan code to resolve a price when priceId is omitted"},"currency":{"type":"string","description":"ISO currency code when resolving a price from the catalog","default":"usd"},"interval":{"type":"string","enum":["MONTH","YEAR"],"description":"Billing interval when resolving a price from the catalog","default":"MONTH"},"successUrl":{"type":"string","description":"Success URL after payment"},"cancelUrl":{"type":"string","description":"Cancel URL if user cancels payment"}},"required":["priceId"]},"AppCheckoutResponseDto":{"type":"object","properties":{"checkoutUrl":{"type":"string"},"sessionId":{"type":"string"}},"required":["checkoutUrl","sessionId"]},"InboxSummaryResponseDto":{"type":"object","properties":{"totalOpen":{"type":"number"},"overdue":{"type":"number"},"approvalsPending":{"type":"number"},"exceptionsOpen":{"type":"number"},"poWritebackNeedsReview":{"type":"number"},"providerOnlyNeedsReview":{"type":"number"},"staleProviderStatuses":{"type":"number"},"syncFailures":{"type":"number"}},"required":["totalOpen","overdue","approvalsPending","exceptionsOpen","poWritebackNeedsReview","providerOnlyNeedsReview","staleProviderStatuses","syncFailures"]},"InboxItemDto":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["EXCEPTION","APPROVAL","PO_WRITEBACK_REPAIR","PROVIDER_PO_REVIEW","STALE_PROVIDER_PO_STATUS"]},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"status":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"supplierName":{"type":"string","nullable":true},"poNumber":{"type":"string","nullable":true},"documentId":{"type":"string","nullable":true},"matchId":{"type":"string","nullable":true},"purchaseOrderId":{"type":"string","nullable":true},"provider":{"type":"string","nullable":true},"createdAt":{"type":"string"},"dueAt":{"type":"string","nullable":true},"deepLink":{"type":"string","nullable":true},"companyId":{"type":"string","nullable":true},"exceptionId":{"type":"string","nullable":true},"approvalRequestId":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true},"metadata":{"type":"object"}},"required":["id","type","severity","status","title","createdAt"]},"InboxListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboxItemDto"}},"nextCursor":{"type":"string","nullable":true}},"required":["data"]},"InboxItemActionDto":{"type":"object","properties":{"action":{"type":"string","enum":["RETRY_PO_WRITEBACK","RESOLVE_BILL_MAPPING_CONFLICT","APPROVE_MATCH_OVERRIDE","OPEN_EXCEPTION","REASSIGN_EXCEPTION","MARK_PROVIDER_PO_REVIEWED","APPROVE_DOCUMENT","REJECT_DOCUMENT","SNOOZE","DISMISS"]},"comment":{"type":"string","description":"Optional comment or decision note recorded with the action."},"assigneeUserId":{"type":"string","description":"Prisma user ID used when reassigning an exception."},"dueAt":{"type":"string","description":"Optional ISO timestamp used to update the exception SLA due date while assigning."},"snoozedUntil":{"type":"string","description":"When snoozing an item, the ISO timestamp to hide it until."},"provider":{"type":"string","description":"Optional provider override for pass-through actions."},"companyId":{"type":"string","description":"Optional company/connection scope for pass-through actions."},"purchaseOrderId":{"type":"string","description":"Optional purchase order ID when retrying PO writeback."},"documentId":{"type":"string","description":"Optional document ID when approving/rejecting a document."}},"required":["action"]},"InboxItemActionResponseDto":{"type":"object","properties":{"itemId":{"type":"string"},"action":{"type":"string","enum":["RETRY_PO_WRITEBACK","RESOLVE_BILL_MAPPING_CONFLICT","APPROVE_MATCH_OVERRIDE","OPEN_EXCEPTION","REASSIGN_EXCEPTION","MARK_PROVIDER_PO_REVIEWED","APPROVE_DOCUMENT","REJECT_DOCUMENT","SNOOZE","DISMISS"]},"status":{"type":"string","enum":["ACCEPTED","COMPLETED","SKIPPED"]},"message":{"type":"string"},"result":{"type":"object"}},"required":["itemId","action","status","message"]},"AssignedApprovalRoleDto":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"maxApprovalAmount":{"type":"number","nullable":true},"assignedAt":{"format":"date-time","type":"string"}},"required":["id","code","description","maxApprovalAmount","assignedAt"]},"TeamMemberDto":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"status":{"type":"string","enum":["active","inactive"]},"membershipStatus":{"type":"string","enum":["active","removed"]},"joinedAt":{"format":"date-time","type":"string"},"avatarUrl":{"type":"string","nullable":true},"approvalRoles":{"type":"array","items":{"$ref":"#/components/schemas/AssignedApprovalRoleDto"}}},"required":["id","email","firstName","lastName","role","status","membershipStatus","joinedAt","avatarUrl","approvalRoles"]},"PendingInviteDto":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"invitedAt":{"format":"date-time","type":"string"},"invitedBy":{"type":"string"},"status":{"type":"string"}},"required":["id","email","role","invitedAt","invitedBy","status"]},"ApprovalRoleDto":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"maxApprovalAmount":{"type":"number","nullable":true},"conflictRoleIds":{"type":"array","items":{"type":"string"}},"conflictRoleCodes":{"type":"array","items":{"type":"string"}},"assignedUserCount":{"type":"number"}},"required":["id","code","description","maxApprovalAmount","conflictRoleIds","conflictRoleCodes","assignedUserCount"]},"SodConflictPairDto":{"type":"object","properties":{"roleIdA":{"type":"string"},"roleCodeA":{"type":"string"},"roleIdB":{"type":"string"},"roleCodeB":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}},"required":["roleIdA","roleCodeA","roleIdB","roleCodeB","createdAt"]},"TeamRolesMatrixDto":{"type":"object","properties":{"roles":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRoleDto"}},"conflicts":{"type":"array","items":{"$ref":"#/components/schemas/SodConflictPairDto"}},"members":{"type":"array","items":{"$ref":"#/components/schemas/TeamMemberDto"}}},"required":["roles","conflicts","members"]},"InviteMemberDto":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]}},"required":["email","role"]},"UpdateUserApprovalRolesDto":{"type":"object","properties":{"roleIds":{"type":"array","items":{"type":"string"}}},"required":["roleIds"]},"UpdateTeamMemberRoleDto":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]}},"required":["role"]},"ActivationBackfillResponseDto":{"type":"object","properties":{"queued":{"type":"boolean"},"taskName":{"type":"string"}},"required":["queued","taskName"]},"ActivationStageCountDto":{"type":"object","properties":{"stage":{"type":"string","enum":["NEEDS_ACCOUNTING_CONNECTION","NEEDS_BOOTSTRAP_SYNC","NEEDS_QUICKBOOKS","NEEDS_APPROVAL_RULE","NEEDS_FIRST_INVOICE","NEEDS_FIRST_CODED_INVOICE","NEEDS_FIRST_APPROVAL_SUBMISSION","NEEDS_FIRST_APPROVAL_COMPLETION","NEEDS_SECOND_PROCESSED_INVOICE","NEEDS_FIRST_WRITEBACK","WRITEBACK_FAILED","ACTIVATED","SUPPRESSED"]},"count":{"type":"number"}},"required":["stage","count"]},"ActivationSummaryDto":{"type":"object","properties":{"clerkSyncedTenants":{"type":"number"},"enrolledTenants":{"type":"number"},"activatedTenants":{"type":"number"},"stageFunnel":{"type":"array","items":{"$ref":"#/components/schemas/ActivationStageCountDto"}},"medianActivationDays":{"type":"number"},"emailsSent":{"type":"number"},"emailsFailed":{"type":"number"},"activationAfterEmailRate":{"type":"number"}},"required":["clerkSyncedTenants","enrolledTenants","activatedTenants","stageFunnel","medianActivationDays","emailsSent","emailsFailed","activationAfterEmailRate"]},"ActivationCustomerDto":{"type":"object","properties":{"tenantId":{"type":"string"},"tenantName":{"type":"string"},"stage":{"type":"string","enum":["NEEDS_ACCOUNTING_CONNECTION","NEEDS_BOOTSTRAP_SYNC","NEEDS_QUICKBOOKS","NEEDS_APPROVAL_RULE","NEEDS_FIRST_INVOICE","NEEDS_FIRST_CODED_INVOICE","NEEDS_FIRST_APPROVAL_SUBMISSION","NEEDS_FIRST_APPROVAL_COMPLETION","NEEDS_SECOND_PROCESSED_INVOICE","NEEDS_FIRST_WRITEBACK","WRITEBACK_FAILED","ACTIVATED","SUPPRESSED"]},"nextAction":{"type":"string","enum":["CONNECT_ACCOUNTING","WAIT_FOR_BOOTSTRAP_SYNC","CONNECT_QUICKBOOKS","CONFIGURE_APPROVALS","UPLOAD_FIRST_INVOICE","COMPLETE_FIRST_CODING","SUBMIT_FIRST_APPROVAL","COMPLETE_FIRST_APPROVAL","PROCESS_SECOND_INVOICE","SYNC_FIRST_INVOICE","RETRY_FIRST_WRITEBACK","NO_EMAIL"]},"primaryUserEmail":{"type":"string"},"lastEmailSentAt":{"type":"string"},"activatedAt":{"type":"string"},"completedAt":{"type":"string"},"quickbooksConnectedAt":{"type":"string"},"bootstrapSyncCompletedAt":{"type":"string"},"approvalRuleConfiguredAt":{"type":"string"},"firstInvoiceAt":{"type":"string"},"firstCodedInvoiceAt":{"type":"string"},"firstApprovalSubmittedAt":{"type":"string"},"firstApprovalCompletedAt":{"type":"string"},"secondProcessedInvoiceAt":{"type":"string"},"firstWritebackStartedAt":{"type":"string"},"firstWritebackConfirmedAt":{"type":"string"},"firstWritebackStatus":{"type":"string"},"secondProcessedInvoiceWithinSevenDays":{"type":"boolean"}},"required":["tenantId","tenantName","stage","nextAction","secondProcessedInvoiceWithinSevenDays"]},"ActivationCustomerListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ActivationCustomerDto"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["data","total","page","limit"]},"ActivationEmailHistoryDto":{"type":"object","properties":{"action":{"type":"string","enum":["CONNECT_ACCOUNTING","WAIT_FOR_BOOTSTRAP_SYNC","CONNECT_QUICKBOOKS","CONFIGURE_APPROVALS","UPLOAD_FIRST_INVOICE","COMPLETE_FIRST_CODING","SUBMIT_FIRST_APPROVAL","COMPLETE_FIRST_APPROVAL","PROCESS_SECOND_INVOICE","SYNC_FIRST_INVOICE","RETRY_FIRST_WRITEBACK","NO_EMAIL"]},"sequenceNumber":{"type":"number"},"sentAt":{"type":"string"},"deliveryStatus":{"type":"string","enum":["PENDING","PROCESSING","SENT","FAILED","SKIPPED"]}},"required":["action","sequenceNumber","sentAt"]},"ActivationCustomerDetailDto":{"type":"object","properties":{"tenantId":{"type":"string"},"tenantName":{"type":"string"},"stage":{"type":"string","enum":["NEEDS_ACCOUNTING_CONNECTION","NEEDS_BOOTSTRAP_SYNC","NEEDS_QUICKBOOKS","NEEDS_APPROVAL_RULE","NEEDS_FIRST_INVOICE","NEEDS_FIRST_CODED_INVOICE","NEEDS_FIRST_APPROVAL_SUBMISSION","NEEDS_FIRST_APPROVAL_COMPLETION","NEEDS_SECOND_PROCESSED_INVOICE","NEEDS_FIRST_WRITEBACK","WRITEBACK_FAILED","ACTIVATED","SUPPRESSED"]},"nextAction":{"type":"string","enum":["CONNECT_ACCOUNTING","WAIT_FOR_BOOTSTRAP_SYNC","CONNECT_QUICKBOOKS","CONFIGURE_APPROVALS","UPLOAD_FIRST_INVOICE","COMPLETE_FIRST_CODING","SUBMIT_FIRST_APPROVAL","COMPLETE_FIRST_APPROVAL","PROCESS_SECOND_INVOICE","SYNC_FIRST_INVOICE","RETRY_FIRST_WRITEBACK","NO_EMAIL"]},"primaryUserEmail":{"type":"string"},"lastEmailSentAt":{"type":"string"},"activatedAt":{"type":"string"},"completedAt":{"type":"string"},"quickbooksConnectedAt":{"type":"string"},"bootstrapSyncCompletedAt":{"type":"string"},"approvalRuleConfiguredAt":{"type":"string"},"firstInvoiceAt":{"type":"string"},"firstCodedInvoiceAt":{"type":"string"},"firstApprovalSubmittedAt":{"type":"string"},"firstApprovalCompletedAt":{"type":"string"},"secondProcessedInvoiceAt":{"type":"string"},"firstWritebackStartedAt":{"type":"string"},"firstWritebackConfirmedAt":{"type":"string"},"firstWritebackStatus":{"type":"string"},"secondProcessedInvoiceWithinSevenDays":{"type":"boolean"},"emailHistory":{"type":"array","items":{"$ref":"#/components/schemas/ActivationEmailHistoryDto"}}},"required":["tenantId","tenantName","stage","nextAction","secondProcessedInvoiceWithinSevenDays","emailHistory"]},"WarmLeadStatusCountDto":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING_ENRICHMENT","READY","AUTO_SENT","ENGAGED","PAUSED","DISQUALIFIED","ARCHIVED","NEEDS_REVIEW"]},"count":{"type":"number"}},"required":["status","count"]},"WarmLeadTierCountDto":{"type":"object","properties":{"tier":{"type":"string","enum":["HIGH_TOUCH_NOW","HIGH_VALUE_WARM","STANDARD"]},"count":{"type":"number"}},"required":["tier","count"]},"WarmLeadLabelCountDto":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"number"}},"required":["label","count"]},"WarmLeadSequenceCountDto":{"type":"object","properties":{"step":{"type":"string","enum":["STEP_1","STEP_2","STEP_3"]},"count":{"type":"number"}},"required":["step","count"]},"WarmLeadSummaryDto":{"type":"object","properties":{"totalLeads":{"type":"number"},"byStatus":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadStatusCountDto"}},"byTier":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadTierCountDto"}},"statusFunnel":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadLabelCountDto"}},"tierFunnel":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadLabelCountDto"}},"sequenceCounts":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadSequenceCountDto"}},"averageScore":{"type":"number"},"pendingReview":{"type":"number"},"readyForAutoSend":{"type":"number"},"engaged":{"type":"number"},"autoSentLast7d":{"type":"number"}},"required":["totalLeads","byStatus","byTier","statusFunnel","tierFunnel","sequenceCounts","averageScore","pendingReview","readyForAutoSend","engaged","autoSentLast7d"]},"WarmLeadPoolMemberDto":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"displayName":{"type":"string"},"notificationEmail":{"type":"string"},"isActive":{"type":"boolean"},"lastAssignedAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","email","displayName","isActive","createdAt","updatedAt"]},"WarmLeadEnrichmentDto":{"type":"object","properties":{"provider":{"type":"string"},"personConfidence":{"type":"number"},"companyConfidence":{"type":"number"},"jobTitle":{"type":"string"},"jobRole":{"type":"string"},"jobSeniority":{"type":"string"},"department":{"type":"string"},"companyName":{"type":"string"},"companyDomain":{"type":"string"},"companyWebsite":{"type":"string"},"industry":{"type":"string"},"employeeRange":{"type":"string"},"revenueRange":{"type":"string"},"hqCountry":{"type":"string"},"rawPersonPayload":{"type":"object"},"rawCompanyPayload":{"type":"object"},"enrichedAt":{"type":"string"}},"required":["provider"]},"WarmLeadScoreBreakdownDto":{"type":"object","properties":{"title":{"type":"number"},"financeFunction":{"type":"number"},"companyFit":{"type":"number"},"productIntent":{"type":"number"},"confidence":{"type":"number"},"total":{"type":"number"}},"required":["title","financeFunction","companyFit","productIntent","confidence","total"]},"WarmLeadSupportConversationDto":{"type":"object","properties":{"ticketId":{"type":"string"},"subject":{"type":"string"},"status":{"type":"string"},"aiStatus":{"type":"string"},"assignedManagerEmail":{"type":"string"},"externalThreadId":{"type":"string"},"updatedAt":{"type":"string"},"lastMessageAt":{"type":"string"}},"required":["ticketId","subject","status"]},"WarmLeadSequenceEventDto":{"type":"object","properties":{"id":{"type":"string"},"step":{"type":"string","enum":["STEP_1","STEP_2","STEP_3"]},"eventType":{"type":"string"},"deliveryStatus":{"type":"string"},"subject":{"type":"string"},"createdAt":{"type":"string"},"metadata":{"type":"object"}},"required":["id","step","eventType","createdAt"]},"WarmLeadListItemDto":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"userId":{"type":"string"},"source":{"type":"string"},"primaryEmail":{"type":"string"},"emailDomain":{"type":"string"},"companyNameFirstParty":{"type":"string"},"status":{"type":"string","enum":["PENDING_ENRICHMENT","READY","AUTO_SENT","ENGAGED","PAUSED","DISQUALIFIED","ARCHIVED","NEEDS_REVIEW"]},"tier":{"type":"string","enum":["HIGH_TOUCH_NOW","HIGH_VALUE_WARM","STANDARD"]},"score":{"type":"number"},"qualificationReason":{"type":"string"},"assignedPoolMemberId":{"type":"string"},"assignedPoolMember":{"$ref":"#/components/schemas/WarmLeadPoolMemberDto"},"supportTicketId":{"type":"string"},"firstAutoSentAt":{"type":"string"},"lastSequenceStepAt":{"type":"string"},"nextSequenceStepAt":{"type":"string"},"lastEnrichedAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"enrichment":{"$ref":"#/components/schemas/WarmLeadEnrichmentDto"},"scoreBreakdown":{"$ref":"#/components/schemas/WarmLeadScoreBreakdownDto"},"supportConversation":{"$ref":"#/components/schemas/WarmLeadSupportConversationDto"},"sequenceEvents":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadSequenceEventDto"}},"notes":{"type":"array","items":{"type":"string"}},"firstPartySignals":{"type":"array","items":{"type":"string"}}},"required":["id","tenantId","userId","source","primaryEmail","status","tier","score","createdAt","updatedAt"]},"WarmLeadListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadListItemDto"}},"total":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["data","total","page","limit"]},"WarmLeadDetailDto":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"userId":{"type":"string"},"source":{"type":"string"},"primaryEmail":{"type":"string"},"emailDomain":{"type":"string"},"companyNameFirstParty":{"type":"string"},"status":{"type":"string","enum":["PENDING_ENRICHMENT","READY","AUTO_SENT","ENGAGED","PAUSED","DISQUALIFIED","ARCHIVED","NEEDS_REVIEW"]},"tier":{"type":"string","enum":["HIGH_TOUCH_NOW","HIGH_VALUE_WARM","STANDARD"]},"score":{"type":"number"},"qualificationReason":{"type":"string"},"assignedPoolMemberId":{"type":"string"},"assignedPoolMember":{"$ref":"#/components/schemas/WarmLeadPoolMemberDto"},"supportTicketId":{"type":"string"},"firstAutoSentAt":{"type":"string"},"lastSequenceStepAt":{"type":"string"},"nextSequenceStepAt":{"type":"string"},"lastEnrichedAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"enrichment":{"$ref":"#/components/schemas/WarmLeadEnrichmentDto"},"scoreBreakdown":{"$ref":"#/components/schemas/WarmLeadScoreBreakdownDto"},"supportConversation":{"$ref":"#/components/schemas/WarmLeadSupportConversationDto"},"sequenceEvents":{"type":"array","items":{"$ref":"#/components/schemas/WarmLeadSequenceEventDto"}},"notes":{"type":"array","items":{"type":"string"}},"firstPartySignals":{"type":"array","items":{"type":"string"}}},"required":["id","tenantId","userId","source","primaryEmail","status","tier","score","createdAt","updatedAt"]},"WarmLeadBackfillResponseDto":{"type":"object","properties":{"queued":{"type":"boolean"},"taskName":{"type":"string"},"scanned":{"type":"number"}},"required":["queued","taskName","scanned"]},"WarmLeadStatusUpdateDto":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING_ENRICHMENT","READY","AUTO_SENT","ENGAGED","PAUSED","DISQUALIFIED","ARCHIVED","NEEDS_REVIEW"]},"reason":{"type":"string"}},"required":["status"]},"WarmLeadReassignDto":{"type":"object","properties":{"assignedPoolMemberId":{"type":"string"}}},"WarmLeadPoolUpsertDto":{"type":"object","properties":{"displayName":{"type":"string"},"notificationEmail":{"type":"string"},"isActive":{"type":"boolean"}},"required":["displayName","isActive"]},"WarmLeadPoolUpdateDto":{"type":"object","properties":{"displayName":{"type":"string"},"notificationEmail":{"type":"string"},"isActive":{"type":"boolean"}},"required":["displayName","isActive"]},"WarmLeadDispositionDto":{"type":"object","properties":{"reason":{"type":"string","enum":["TOO_SMALL","WRONG_INDUSTRY","WRONG_PERSONA","UNSUPPORTED_ERP","RESEARCH_ONLY","NO_ACTIVE_NEED","TIMING","DUPLICATE","COMPETITOR","INVALID","OTHER"]},"notes":{"type":"string","description":"Required when reason is OTHER."},"reconsiderAt":{"type":"string","description":"ISO date to revisit the lead (TIMING dispositions only)."}},"required":["reason"]},"CreateOpportunityDto":{"type":"object","properties":{}},"CloseOpportunityDto":{"type":"object","properties":{}},"AdminCustomerDTO":{"type":"object","properties":{"id":{"type":"string","description":"Tenant ID"},"name":{"type":"string","description":"Company/Tenant name"},"plan":{"type":"string","description":"Plan code","enum":["FREE","TEAM","GROWTH","ENTERPRISE"]},"status":{"type":"string","description":"Customer status","enum":["active","trialing","at-risk","churned"]},"mrr":{"type":"number","description":"Monthly recurring revenue in cents"},"seatsUsed":{"type":"number","description":"Number of seats used"},"docsProcessedMonth":{"type":"number","description":"Documents processed this month"},"lastActiveAt":{"type":"string","description":"Last activity timestamp"},"createdAt":{"type":"string","description":"Tenant creation timestamp"}},"required":["id","name","plan","status","mrr","seatsUsed","docsProcessedMonth","lastActiveAt","createdAt"]},"AdminCustomerListResponseDTO":{"type":"object","properties":{"data":{"description":"List of customers","type":"array","items":{"$ref":"#/components/schemas/AdminCustomerDTO"}},"nextCursor":{"type":"string","description":"Next page cursor"},"total":{"type":"number","description":"Total count of customers"}},"required":["data","total"]},"AdminCustomerIntegrationDTO":{"type":"object","properties":{"id":{"type":"string","description":"Integration ID"},"provider":{"type":"string","description":"Provider name"},"type":{"type":"string","description":"Integration type"},"status":{"type":"string","description":"Integration status"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"documentsProcessed":{"type":"number","description":"Documents processed via this integration"}},"required":["id","provider","type","status","documentsProcessed"]},"AdminCustomerActivityDTO":{"type":"object","properties":{"date":{"type":"string","description":"Date of activity"},"documents":{"type":"number","description":"Documents processed"},"matches":{"type":"number","description":"Matches created"},"exceptions":{"type":"number","description":"Exceptions created"}},"required":["date","documents","matches","exceptions"]},"AdminCustomerOnboardingDTO":{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant ID"},"currentStep":{"type":"string","description":"Current onboarding step","enum":["connect-accounting","services","company-details","intro","how-to","completed"]},"completionPercentage":{"type":"number","description":"Completion percentage (0-100)"},"hasIntegration":{"type":"boolean","description":"Has connected accounting integration"},"hasSelectedServices":{"type":"boolean","description":"Has selected services"},"hasCompanyDetails":{"type":"boolean","description":"Has completed company details"},"onboardingCompletedAt":{"type":"string","description":"Onboarding completion timestamp"},"onboardingStartedAt":{"type":"string","description":"Onboarding start timestamp (tenant creation)"},"daysSinceStart":{"type":"number","description":"Days since onboarding started"},"stuckDays":{"type":"number","description":"Days stuck on current step (null if completed or just started)"}},"required":["tenantId","currentStep","completionPercentage","hasIntegration","hasSelectedServices","hasCompanyDetails","onboardingStartedAt","daysSinceStart"]},"AdminCustomerAddressDTO":{"type":"object","properties":{"line1":{"type":"string","description":"Address line 1"},"line2":{"type":"string","description":"Address line 2"},"city":{"type":"string","description":"City"},"stateProvince":{"type":"string","description":"State or province"},"postalCode":{"type":"string","description":"Postal code"},"country":{"type":"string","description":"Country"}}},"AdminCustomerSelectedServiceDTO":{"type":"object","properties":{"id":{"type":"string","description":"Selected service record ID"},"serviceId":{"type":"string","description":"Service identifier"},"title":{"type":"string","description":"Service title"},"selectedAt":{"type":"string","description":"When the service was selected"}},"required":["id","serviceId","title","selectedAt"]},"AdminCustomerPrimaryContactDTO":{"type":"object","properties":{"firstName":{"type":"string","description":"First name"},"lastName":{"type":"string","description":"Last name"},"email":{"type":"string","description":"Email address"}},"required":["email"]},"AdminCustomerUserDTO":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]}},"required":["id","email","role"]},"AdminCustomerSupportProfileDTO":{"type":"object","properties":{"standardSlaHours":{"type":"number"},"prioritySlaHours":{"type":"number"},"managerName":{"type":"string"},"managerEmail":{"type":"string"},"schedulerUrl":{"type":"string"},"notes":{"type":"string"}},"required":["standardSlaHours","prioritySlaHours"]},"AdminCustomerEnterpriseOnboardingPlanDTO":{"type":"object","properties":{"stage":{"type":"string","enum":["NOT_STARTED","KICKOFF_SCHEDULED","IN_PROGRESS","BLOCKED","COMPLETED"]},"kickoffScheduledAt":{"type":"string"},"targetGoLiveAt":{"type":"string"},"blockers":{"type":"array","items":{"type":"string"}},"notes":{"type":"string"},"completedAt":{"type":"string"}},"required":["stage"]},"AdminCustomerJourneyConfigurationItemDTO":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["complete","missing"]},"detail":{"type":"string"}},"required":["key","label","status","detail"]},"AdminCustomerJourneyStepDTO":{"type":"object","properties":{"action":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"href":{"type":"string"},"status":{"type":"string","enum":["complete","current","upcoming"]}},"required":["action","label","description","href","status"]},"AdminCustomerJourneySupportDTO":{"type":"object","properties":{"managerName":{"type":"string"},"managerEmail":{"type":"string"},"schedulerUrl":{"type":"string"}}},"AdminCustomerJourneyDTO":{"type":"object","properties":{"stage":{"type":"string"},"stageLabel":{"type":"string"},"headline":{"type":"string"},"summary":{"type":"string"},"whyItMatters":{"type":"string"},"howToUse":{"type":"array","items":{"type":"string"}},"configurationItems":{"type":"array","items":{"$ref":"#/components/schemas/AdminCustomerJourneyConfigurationItemDTO"}},"nextSteps":{"type":"array","items":{"$ref":"#/components/schemas/AdminCustomerJourneyStepDTO"}},"support":{"$ref":"#/components/schemas/AdminCustomerJourneySupportDTO"},"generatedAt":{"type":"string"}},"required":["stage","stageLabel","headline","summary","whyItMatters","howToUse","configurationItems","nextSteps","generatedAt"]},"AdminCustomerDetailDTO":{"type":"object","properties":{"id":{"type":"string","description":"Tenant ID"},"name":{"type":"string","description":"Company/Tenant name"},"plan":{"type":"string","description":"Plan code","enum":["FREE","TEAM","GROWTH","ENTERPRISE"]},"status":{"type":"string","description":"Customer status","enum":["active","trialing","at-risk","churned"]},"mrr":{"type":"number","description":"Monthly recurring revenue in cents"},"seatsUsed":{"type":"number","description":"Number of seats used"},"docsProcessedMonth":{"type":"number","description":"Documents processed this month"},"lastActiveAt":{"type":"string","description":"Last activity timestamp"},"createdAt":{"type":"string","description":"Tenant creation timestamp"},"email":{"type":"string","description":"Primary contact email"},"totalDocsProcessed":{"type":"number","description":"Total documents processed all time"},"totalMatchesCleared":{"type":"number","description":"Total matches cleared all time"},"exceptionsOpen":{"type":"number","description":"Currently open exceptions"},"integrations":{"description":"Connected integrations","type":"array","items":{"$ref":"#/components/schemas/AdminCustomerIntegrationDTO"}},"recentActivity":{"description":"Recent activity","type":"array","items":{"$ref":"#/components/schemas/AdminCustomerActivityDTO"}},"onboarding":{"description":"Onboarding status","allOf":[{"$ref":"#/components/schemas/AdminCustomerOnboardingDTO"}]},"companyWebsite":{"type":"string","description":"Company website"},"logoUrl":{"type":"string","description":"Company logo URL"},"address":{"description":"Company address","allOf":[{"$ref":"#/components/schemas/AdminCustomerAddressDTO"}]},"selectedServices":{"description":"Selected services","type":"array","items":{"$ref":"#/components/schemas/AdminCustomerSelectedServiceDTO"}},"primaryContact":{"description":"Primary contact information","allOf":[{"$ref":"#/components/schemas/AdminCustomerPrimaryContactDTO"}]},"users":{"description":"Users associated with this customer tenant","type":"array","items":{"$ref":"#/components/schemas/AdminCustomerUserDTO"}},"onboardingStartedAt":{"type":"string","description":"When onboarding started (tenant creation)"},"onboardingCompletedAt":{"type":"string","description":"When onboarding was completed"},"qualificationAnswers":{"type":"object","description":"Saved onboarding qualification answers","additionalProperties":true},"supportProfile":{"description":"Support profile for this customer","allOf":[{"$ref":"#/components/schemas/AdminCustomerSupportProfileDTO"}]},"enterpriseOnboardingPlan":{"description":"Enterprise onboarding plan for this customer","allOf":[{"$ref":"#/components/schemas/AdminCustomerEnterpriseOnboardingPlanDTO"}]},"journey":{"description":"Customer-facing onboarding journey preview","allOf":[{"$ref":"#/components/schemas/AdminCustomerJourneyDTO"}]},"trialEndsAt":{"type":"string","description":"Active trial end timestamp, if the tenant is currently trialing."},"trialPlanCode":{"type":"string","description":"Plan code granted through the active trial.","enum":["FREE","TEAM","GROWTH","SCALE","ENTERPRISE","APPSUMO_T1","APPSUMO_T2","APPSUMO_T3"]},"trialExtendedAt":{"type":"string","description":"When the trial was extended after an attended setup call (once per tenant)."},"trialExtensionReason":{"type":"string","description":"Why the trial was extended, e.g. 'setup_call'."}},"required":["id","name","plan","status","mrr","seatsUsed","docsProcessedMonth","lastActiveAt","createdAt","totalDocsProcessed","totalMatchesCleared","exceptionsOpen","integrations","recentActivity","selectedServices","users"]},"AdminCustomerMessagePreviewRequestDTO":{"type":"object","properties":{"recipientUserIds":{"type":"array","items":{"type":"string"}},"messageGoal":{"type":"string","description":"Plain-language description of what you want the email to accomplish."},"context":{"type":"string","description":"Additional facts, context, or constraints to include."},"personalizationGuidance":{"type":"string","description":"Optional commercial guidance about the recipient, for example title, seniority, intent, or how the outreach should be framed."},"tone":{"type":"string","description":"Preferred tone, for example calm, direct, empathetic, or urgent."},"callToAction":{"type":"string","description":"Optional closing action you want the user to take."}},"required":["recipientUserIds","messageGoal"]},"AdminCustomerMessagePreviewRecipientDTO":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"required":["id","email"]},"AdminCustomerMessagePreviewResponseDTO":{"type":"object","properties":{"subject":{"type":"string"},"bodyText":{"type":"string"},"leadScore":{"type":"number"},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH"]},"buyerSummary":{"type":"string"},"recommendedMotion":{"type":"string"},"discoveryQuestions":{"type":"array","items":{"type":"string"}},"crmNotes":{"type":"array","items":{"type":"string"}},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/AdminCustomerMessagePreviewRecipientDTO"}}},"required":["subject","bodyText","leadScore","priority","buyerSummary","recommendedMotion","discoveryQuestions","crmNotes","recipients"]},"AdminCustomerMessageSendRequestDTO":{"type":"object","properties":{"recipientUserIds":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"bodyText":{"type":"string"},"enableAiReplies":{"type":"boolean","description":"When true, inbound replies stay on a tracked thread and AI can handle them before escalating to a human.","default":true}},"required":["recipientUserIds","subject","bodyText"]},"AdminCustomerMessageSendFailureDTO":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"error":{"type":"string"}},"required":["userId","email","error"]},"AdminCustomerMessageSendResponseDTO":{"type":"object","properties":{"sentCount":{"type":"number"},"failedCount":{"type":"number"},"failures":{"type":"array","items":{"$ref":"#/components/schemas/AdminCustomerMessageSendFailureDTO"}}},"required":["sentCount","failedCount","failures"]},"AdminCustomerTrialResetResponseDTO":{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant ID"},"trialEndsAt":{"type":"string","description":"Trial end timestamp"},"trialPlanCode":{"type":"string","enum":["FREE","TEAM","GROWTH","SCALE","ENTERPRISE","APPSUMO_T1","APPSUMO_T2","APPSUMO_T3"],"description":"Trial plan code applied"},"emailSent":{"type":"boolean","description":"Whether the confirmation email was queued or sent"},"recipients":{"description":"Recipients notified","type":"array","items":{"type":"string"}},"trialSource":{"type":"string","description":"Which billing system owns the reset trial after this action.","enum":["STRIPE","TENANT"]}},"required":["tenantId","trialEndsAt","trialPlanCode","emailSent","recipients","trialSource"]},"AdminTrialExtensionResponseDTO":{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant ID"},"status":{"type":"string","enum":["EXTENDED","ALREADY_EXTENDED","ALREADY_AT_CAP"],"description":"EXTENDED: trial end moved. ALREADY_EXTENDED: a previous setup-call extension exists (no-op). ALREADY_AT_CAP: the trial already runs to or past the 30-day cap (no-op)."},"trialEndsAt":{"type":"string","description":"Trial end after this action"},"daysAdded":{"type":"number","description":"Days added by this action (0 for a no-op)"},"trialSource":{"type":"string","enum":["STRIPE","TENANT"],"description":"Which billing system owns the trial."},"emailSent":{"type":"boolean","description":"Whether a confirmation email was sent"}},"required":["tenantId","status","daysAdded","trialSource","emailSent"]},"AdminDemoBookingDTO":{"type":"object","properties":{"id":{"type":"string"},"bookingReference":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"sourcePage":{"type":"string"},"status":{"type":"string","enum":["REQUESTED","CONFIRMED","CANCELLED","CONVERTED","ATTENDED","NO_SHOW"]},"attendanceMarkedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","bookingReference","email","status","createdAt"]},"AdminDemoBookingAttendanceRequestDTO":{"type":"object","properties":{"outcome":{"type":"string","enum":["ATTENDED","NO_SHOW"]}},"required":["outcome"]},"AdminDemoBookingAttendanceResponseDTO":{"type":"object","properties":{"booking":{"$ref":"#/components/schemas/AdminDemoBookingDTO"},"extension":{"description":"Present when the call was marked attended.","allOf":[{"$ref":"#/components/schemas/AdminTrialExtensionResponseDTO"}]}},"required":["booking"]},"AdminCustomerCreateDTO":{"type":"object","properties":{"name":{"type":"string","description":"Company/Tenant name"},"email":{"type":"string","description":"Primary contact email"},"plan":{"type":"string","description":"Plan code","enum":["FREE","TEAM","GROWTH","ENTERPRISE"]}},"required":["name"]},"AdminCustomerUpdateDTO":{"type":"object","properties":{"name":{"type":"string","description":"Company/Tenant name"},"plan":{"type":"string","description":"Plan code","enum":["FREE","TEAM","GROWTH","ENTERPRISE"]}}},"AdminDashboardExceptionsByStatusDTO":{"type":"object","properties":{"status":{"type":"string","description":"Exception status"},"count":{"type":"number","description":"Count of exceptions with this status"}},"required":["status","count"]},"AdminDashboardSummaryDTO":{"type":"object","properties":{"totalCustomers":{"type":"number","description":"Total number of customers (tenants)"},"activeCustomers":{"type":"number","description":"Number of active customers"},"totalMrr":{"type":"number","description":"Total monthly recurring revenue in cents"},"docsProcessedLast24h":{"type":"number","description":"Documents processed in last 24 hours"},"matchesClearedRate":{"type":"number","description":"Matches cleared rate (percentage)"},"exceptionsByStatus":{"description":"Exceptions grouped by status","type":"array","items":{"$ref":"#/components/schemas/AdminDashboardExceptionsByStatusDTO"}},"docsProcessedThisMonth":{"type":"number","description":"Documents processed this month"},"matchesThisMonth":{"type":"number","description":"Total matches created this month"},"exceptionsThisMonth":{"type":"number","description":"Exceptions created this month"},"newCustomersThisMonth":{"type":"number","description":"New customers this month"}},"required":["totalCustomers","activeCustomers","totalMrr","docsProcessedLast24h","matchesClearedRate","exceptionsByStatus","docsProcessedThisMonth","matchesThisMonth","exceptionsThisMonth","newCustomersThisMonth"]},"ConversionFunnelDTO":{"type":"object","properties":{"signups":{"type":"number","description":"Total signups in the period"},"demoSignups":{"type":"number","description":"Demo signups in the period"},"trialStarts":{"type":"number","description":"Trial starts in the period (non-demo, non-FREE with trialEndsAt)"},"paidConversions":{"type":"number","description":"Paid conversions in the period"},"demoToTrialRate":{"type":"number","description":"Demo-to-trial conversion rate (0-1)"},"trialToPaidRate":{"type":"number","description":"Trial-to-paid conversion rate (0-1)"},"period":{"type":"string","description":"Time period used"}},"required":["signups","demoSignups","trialStarts","paidConversions","demoToTrialRate","trialToPaidRate","period"]},"MrrDTO":{"type":"object","properties":{"totalMrr":{"type":"number","description":"Total MRR in cents"},"byPlan":{"description":"MRR breakdown by plan","type":"array","items":{"type":"string"}},"payingCustomers":{"type":"number","description":"Total paying customers"}},"required":["totalMrr","byPlan","payingCustomers"]},"AdminExceptionDTO":{"type":"object","properties":{"id":{"type":"string","description":"Exception ID"},"documentId":{"type":"string","description":"Document ID"},"documentName":{"type":"string","description":"Document name or identifier"},"customerId":{"type":"string","description":"Customer (tenant) ID"},"customerName":{"type":"string","description":"Customer (tenant) name"},"type":{"type":"string","description":"Exception type/reason"},"status":{"type":"string","description":"Exception status","enum":["OPEN","INVESTIGATING","AWAITING_VENDOR","PENDING_SUPPLIER","RESOLUTION_PROPOSED","ESCALATED","RESOLVED"]},"assignee":{"type":"string","description":"Assigned user email"},"createdAt":{"type":"string","description":"Exception creation timestamp"},"resolvedAt":{"type":"string","description":"Resolution timestamp"},"description":{"type":"string","description":"Exception description/reason"}},"required":["id","documentId","documentName","customerId","customerName","type","status","createdAt","description"]},"AdminExceptionListResponseDTO":{"type":"object","properties":{"data":{"description":"List of exceptions","type":"array","items":{"$ref":"#/components/schemas/AdminExceptionDTO"}},"nextCursor":{"type":"string","description":"Next page cursor"}},"required":["data"]},"AdminIntegrationDTO":{"type":"object","properties":{"id":{"type":"string","description":"Integration ID"},"type":{"type":"string","description":"Integration type (MERGE, SFTP)"},"provider":{"type":"string","description":"Provider name (e.g., QuickBooks, Xero)"},"status":{"type":"string","description":"Integration status","enum":["PENDING","CONNECTED","SYNCING","ERROR","DISCONNECTED"]},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"createdAt":{"type":"string","description":"Integration creation timestamp"},"errorMessage":{"type":"string","description":"Error message if status is ERROR"},"boundaryWarningCount":{"type":"number","description":"Number of recorded boundary warnings"},"boundaryErrorCount":{"type":"number","description":"Number of recorded boundary errors"},"boundarySkippedByReason":{"type":"object","description":"Skipped or warning boundary events grouped by reason code"},"customerId":{"type":"string","description":"Customer (tenant) ID"},"customerName":{"type":"string","description":"Customer (tenant) name"}},"required":["id","type","status","createdAt","customerId","customerName"]},"AdminIntegrationListResponseDTO":{"type":"object","properties":{"data":{"description":"List of integrations","type":"array","items":{"$ref":"#/components/schemas/AdminIntegrationDTO"}},"nextCursor":{"type":"string","description":"Next page cursor"}},"required":["data"]},"OnboardingDropOffDTO":{"type":"object","properties":{"step":{"type":"string","description":"Onboarding step","enum":["connect-accounting","services","company-details","intro","how-to","completed"]},"count":{"type":"number","description":"Number of customers at this step"},"percentage":{"type":"number","description":"Percentage of total customers"}},"required":["step","count","percentage"]},"StuckCustomerDTO":{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant ID"},"name":{"type":"string","description":"Customer name"},"step":{"type":"string","description":"Current onboarding step","enum":["connect-accounting","services","company-details","intro","how-to","completed"]},"daysSinceActivity":{"type":"number","description":"Days since last activity"}},"required":["tenantId","name","step","daysSinceActivity"]},"RecentCompletionDTO":{"type":"object","properties":{"tenantId":{"type":"string","description":"Tenant ID"},"name":{"type":"string","description":"Customer name"},"completedAt":{"type":"string","description":"Completion timestamp"}},"required":["tenantId","name","completedAt"]},"AdminOnboardingAnalyticsDTO":{"type":"object","properties":{"totalCustomers":{"type":"number","description":"Total number of customers"},"completedOnboarding":{"type":"number","description":"Customers who completed onboarding"},"inProgressOnboarding":{"type":"number","description":"Customers currently in onboarding"},"completionRate":{"type":"number","description":"Onboarding completion rate (0-100)"},"averageCompletionDays":{"type":"number","description":"Average days to complete onboarding"},"dropOffByStep":{"description":"Drop-off by step","type":"array","items":{"$ref":"#/components/schemas/OnboardingDropOffDTO"}},"stuckCustomers":{"description":"Customers stuck in onboarding","type":"array","items":{"$ref":"#/components/schemas/StuckCustomerDTO"}},"recentCompletions":{"description":"Recent onboarding completions","type":"array","items":{"$ref":"#/components/schemas/RecentCompletionDTO"}}},"required":["totalCustomers","completedOnboarding","inProgressOnboarding","completionRate","averageCompletionDays","dropOffByStep","stuckCustomers","recentCompletions"]},"AdminAuditEventDto":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"action":{"type":"string"},"actorType":{"type":"string"},"actorName":{"type":"string"},"actorEmail":{"type":"string"},"tenantId":{"type":"string"},"tenantName":{"type":"string"},"exceptionId":{"type":"string"},"comment":{"type":"string"}},"required":["id","timestamp","action","actorType","tenantId","tenantName","exceptionId"]},"AdminAuditListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AdminAuditEventDto"}},"nextCursor":{"type":"string"}},"required":["data"]},"AdminUserRecordDto":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"tenantId":{"type":"string"},"tenantName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","email","role","tenantId","tenantName","createdAt","updatedAt"]},"AdminUserListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserRecordDto"}},"nextCursor":{"type":"string"}},"required":["data"]},"BulkUserRoleUpdateRequestDto":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]}},"required":["userIds","role"]},"BulkUserRoleErrorDto":{"type":"object","properties":{"userId":{"type":"string"},"message":{"type":"string"}},"required":["userId","message"]},"BulkUserRoleUpdateResponseDto":{"type":"object","properties":{"updatedCount":{"type":"number"},"skippedCount":{"type":"number"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/BulkUserRoleErrorDto"}}},"required":["updatedCount","skippedCount","errors"]},"PermissionSimulationRequestDto":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]},"action":{"type":"string","enum":["view_dashboard","resolve_exception","manage_integrations","manage_workflows","manage_users","manage_billing"]},"plan":{"type":"string","enum":["FREE","TEAM","GROWTH","SCALE","ENTERPRISE","APPSUMO_T1","APPSUMO_T2","APPSUMO_T3"]}},"required":["role","action"]},"PermissionSimulationResponseDto":{"type":"object","properties":{"allowed":{"type":"boolean"},"reason":{"type":"string"},"requiredRole":{"type":"string"},"action":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER"]}},"required":["allowed","reason","requiredRole","action","role"]},"AdminObservabilityStatusDto":{"type":"object","properties":{"apiStatus":{"type":"string","enum":["ok","degraded","down"]},"dbStatus":{"type":"string","enum":["ok","degraded","down"]},"failingIntegrations":{"type":"number"},"unresolvedExceptions":{"type":"number"},"openIncidents":{"type":"number"},"generatedAt":{"type":"string","format":"date-time"}},"required":["apiStatus","dbStatus","failingIntegrations","unresolvedExceptions","openIncidents","generatedAt"]},"AdminIncidentDto":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["integration","autonomous-agent","exception"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"title":{"type":"string"},"description":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"tenantName":{"type":"string"}},"required":["id","type","severity","title","description","timestamp"]},"AdminIncidentListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AdminIncidentDto"}}},"required":["data"]},"QuickBooksDiagnosticLinkedPoDto":{"type":"object","properties":{"qboId":{"type":"string"},"poNumber":{"type":"string"},"nexusPoId":{"type":"string"},"mappingFound":{"type":"boolean"}},"required":["qboId","mappingFound"]},"QuickBooksDiagnosticSkipReasonDto":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINKED_PO","MULTIPLE_LINKED_POS","PO_MAPPING_MISSING","DOCUMENT_NOT_READY","MATCH_EXISTS","MISSING_PO_REQUIRED","PO_OPTIONAL_APPLIED","SUPPLIER_NOT_MAPPED","STALE_OCR_FAILURE_STATE","MATCH_TASK_MISSING","MATCH_TASK_FAILED","READY_TO_MATCH"]},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["info","warning","critical"]},"allowedRepairActions":{"type":"array","items":{"type":"string","enum":["REQUEUE_MATCH","REAPPLY_LINKED_PO","RERUN_QBO_BILL_SYNC","CLEAR_STALE_OCR_STATE","RERUN_CONTROLS"]}},"customerSafeSummary":{"type":"string"}},"required":["code","title","description","severity","allowedRepairActions","customerSafeSummary"]},"QuickBooksDiagnosticTaskDto":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"retryCount":{"type":"number"},"errorMsg":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","retryCount","createdAt","updatedAt"]},"QuickBooksDiagnosticRowDto":{"type":"object","properties":{"documentId":{"type":"string"},"tenantId":{"type":"string"},"tenantName":{"type":"string"},"sourceType":{"type":"string","enum":["QUICKBOOKS_API","XERO_API","FRESHBOOKS_API","ZOHO_API","UPLOAD_OCR","EMAIL_OCR","SFTP","UNKNOWN"]},"erpProvider":{"type":"string","enum":["QUICKBOOKS","XERO","FRESHBOOKS","ZOHO"]},"erpBillId":{"type":"string"},"quickBooksConnectionId":{"type":"string"},"quickBooksBillId":{"type":"string"},"invoiceNumber":{"type":"string"},"supplierName":{"type":"string"},"appliedPoNumber":{"type":"string"},"linkedPurchaseOrders":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksDiagnosticLinkedPoDto"}},"documentStatus":{"type":"string"},"codingStatus":{"type":"string"},"approvalStatus":{"type":"string"},"skipReason":{"$ref":"#/components/schemas/QuickBooksDiagnosticSkipReasonDto"},"latestMatchTask":{"$ref":"#/components/schemas/QuickBooksDiagnosticTaskDto"},"customerViewUrl":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"}},"required":["documentId","tenantId","tenantName","sourceType","linkedPurchaseOrders","documentStatus","codingStatus","approvalStatus","skipReason","customerViewUrl","updatedAt"]},"QuickBooksDiagnosticListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksDiagnosticRowDto"}},"nextCursor":{"type":"string"},"canRepair":{"type":"boolean"}},"required":["data","canRepair"]},"QuickBooksDiagnosticTelemetryBucketDto":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINKED_PO","MULTIPLE_LINKED_POS","PO_MAPPING_MISSING","DOCUMENT_NOT_READY","MATCH_EXISTS","MISSING_PO_REQUIRED","PO_OPTIONAL_APPLIED","SUPPLIER_NOT_MAPPED","STALE_OCR_FAILURE_STATE","MATCH_TASK_MISSING","MATCH_TASK_FAILED","READY_TO_MATCH"]},"title":{"type":"string"},"count":{"type":"number"},"percentage":{"type":"number"}},"required":["code","title","count","percentage"]},"QuickBooksDiagnosticTelemetryResponseDto":{"type":"object","properties":{"total":{"type":"number"},"buckets":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksDiagnosticTelemetryBucketDto"}}},"required":["total","buckets"]},"QuickBooksDiagnosticTemplateDto":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINKED_PO","MULTIPLE_LINKED_POS","PO_MAPPING_MISSING","DOCUMENT_NOT_READY","MATCH_EXISTS","MISSING_PO_REQUIRED","PO_OPTIONAL_APPLIED","SUPPLIER_NOT_MAPPED","STALE_OCR_FAILURE_STATE","MATCH_TASK_MISSING","MATCH_TASK_FAILED","READY_TO_MATCH"]},"template":{"type":"string"},"isCustom":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}},"required":["code","template","isCustom"]},"QuickBooksDiagnosticTemplateListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksDiagnosticTemplateDto"}}},"required":["data"]},"UpdateQuickBooksDiagnosticTemplateRequestDto":{"type":"object","properties":{"template":{"type":"string"}},"required":["template"]},"QuickBooksDiagnosticDetailDto":{"type":"object","properties":{"documentId":{"type":"string"},"tenantId":{"type":"string"},"tenantName":{"type":"string"},"sourceType":{"type":"string","enum":["QUICKBOOKS_API","XERO_API","FRESHBOOKS_API","ZOHO_API","UPLOAD_OCR","EMAIL_OCR","SFTP","UNKNOWN"]},"erpProvider":{"type":"string","enum":["QUICKBOOKS","XERO","FRESHBOOKS","ZOHO"]},"erpBillId":{"type":"string"},"quickBooksConnectionId":{"type":"string"},"quickBooksBillId":{"type":"string"},"invoiceNumber":{"type":"string"},"supplierName":{"type":"string"},"appliedPoNumber":{"type":"string"},"linkedPurchaseOrders":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksDiagnosticLinkedPoDto"}},"documentStatus":{"type":"string"},"codingStatus":{"type":"string"},"approvalStatus":{"type":"string"},"skipReason":{"$ref":"#/components/schemas/QuickBooksDiagnosticSkipReasonDto"},"latestMatchTask":{"$ref":"#/components/schemas/QuickBooksDiagnosticTaskDto"},"customerViewUrl":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"errorMessage":{"type":"string"},"needsReviewReason":{"type":"string"},"poRequirementExplanation":{"type":"string"},"rawPayload":{"type":"object"},"canRepair":{"type":"boolean"},"auditTrail":{"type":"array","items":{"$ref":"#/components/schemas/AdminAuditEventDto"}}},"required":["documentId","tenantId","tenantName","sourceType","linkedPurchaseOrders","documentStatus","codingStatus","approvalStatus","skipReason","customerViewUrl","updatedAt","canRepair","auditTrail"]},"QuickBooksDiagnosticRepairRequestDto":{"type":"object","properties":{"action":{"type":"string","enum":["REQUEUE_MATCH","REAPPLY_LINKED_PO","RERUN_QBO_BILL_SYNC","CLEAR_STALE_OCR_STATE","RERUN_CONTROLS"]},"confirmText":{"type":"string"}},"required":["action"]},"QuickBooksDiagnosticRepairResponseDto":{"type":"object","properties":{"documentId":{"type":"string"},"action":{"type":"string","enum":["REQUEUE_MATCH","REAPPLY_LINKED_PO","RERUN_QBO_BILL_SYNC","CLEAR_STALE_OCR_STATE","RERUN_CONTROLS"]},"before":{"type":"object"},"after":{"type":"object"},"taskId":{"type":"string"},"auditEventId":{"type":"string"}},"required":["documentId","action","before","after"]},"QuickBooksDiagnosticListQueryDto":{"type":"object","properties":{"tenantId":{"type":"string"},"provider":{"type":"string","enum":["quickbooks","xero","freshbooks","zoho"]},"connectionId":{"type":"string"},"invoiceNumber":{"type":"string"},"billId":{"type":"string"},"poNumber":{"type":"string"},"supplier":{"type":"string"},"skipReason":{"type":"string","enum":["NO_LINKED_PO","MULTIPLE_LINKED_POS","PO_MAPPING_MISSING","DOCUMENT_NOT_READY","MATCH_EXISTS","MISSING_PO_REQUIRED","PO_OPTIONAL_APPLIED","SUPPLIER_NOT_MAPPED","STALE_OCR_FAILURE_STATE","MATCH_TASK_MISSING","MATCH_TASK_FAILED","READY_TO_MATCH"]},"status":{"type":"string"},"dateFrom":{"type":"string"},"dateTo":{"type":"string"},"sortBy":{"type":"string","enum":["updatedAt","createdAt","documentDate"]},"sortDirection":{"type":"string","enum":["asc","desc"]},"limit":{"type":"number"},"cursor":{"type":"string"}}},"QuickBooksDiagnosticBulkRepairRequestDto":{"type":"object","properties":{"action":{"type":"string","enum":["REQUEUE_MATCH","REAPPLY_LINKED_PO","RERUN_QBO_BILL_SYNC","CLEAR_STALE_OCR_STATE","RERUN_CONTROLS"]},"confirmText":{"type":"string"},"documentIds":{"type":"array","items":{"type":"string"}},"filter":{"$ref":"#/components/schemas/QuickBooksDiagnosticListQueryDto"},"previewOnly":{"type":"boolean"}},"required":["action"]},"QuickBooksDiagnosticBulkRepairResponseDto":{"type":"object","properties":{"matchedCount":{"type":"number"},"repairedCount":{"type":"number"},"skippedCount":{"type":"number"},"repairs":{"type":"array","items":{"$ref":"#/components/schemas/QuickBooksDiagnosticRepairResponseDto"}},"errors":{"type":"array","items":{"type":"string"}}},"required":["matchedCount","repairedCount","skippedCount","repairs","errors"]},"ImportSearchTermsDto":{"type":"object","properties":{}},"ReviewSearchTermDto":{"type":"object","properties":{}},"CompanyDto":{"type":"object","properties":{"id":{"type":"string","description":"QuickBooks connection ID"},"realmId":{"type":"string","description":"QuickBooks realm ID"},"companyName":{"type":"string","description":"Company name"},"environment":{"type":"string","description":"Environment (sandbox or production)"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"accessLevel":{"type":"string","description":"User access level for this company"},"isActive":{"type":"boolean","description":"Whether the connection is active"}},"required":["id","realmId","companyName","accessLevel","isActive"]},"CompanyListResponseDto":{"type":"object","properties":{"data":{"description":"List of accessible companies","type":"array","items":{"$ref":"#/components/schemas/CompanyDto"}},"canViewAllCompanies":{"type":"boolean","description":"Whether user can view all companies (OWNER/ADMIN)"}},"required":["data","canViewAllCompanies"]},"CompanyStatsDto":{"type":"object","properties":{"companyId":{"type":"string","description":"QuickBooks connection ID"},"companyName":{"type":"string","description":"Company name"},"documentCount":{"type":"number","description":"Number of documents"},"supplierCount":{"type":"number","description":"Number of suppliers"},"purchaseOrderCount":{"type":"number","description":"Number of purchase orders"}},"required":["companyId","companyName","documentCount","supplierCount","purchaseOrderCount"]},"CompanyStatsResponseDto":{"type":"object","properties":{"byCompany":{"description":"Stats per company","type":"array","items":{"$ref":"#/components/schemas/CompanyStatsDto"}},"totals":{"type":"object","description":"Total counts across all accessible companies"}},"required":["byCompany","totals"]},"CompanyUserDto":{"type":"object","properties":{"id":{"type":"string","description":"User ID"},"email":{"type":"string","description":"User email"},"firstName":{"type":"string","description":"User first name"},"lastName":{"type":"string","description":"User last name"},"role":{"type":"string","description":"User role in tenant"},"accessLevel":{"type":"string","description":"Access level for this company"},"grantedAt":{"type":"string","description":"When access was granted"},"grantedBy":{"type":"string","description":"Who granted the access"}},"required":["id","email","role","accessLevel","grantedAt"]},"CompanyUsersResponseDto":{"type":"object","properties":{"data":{"description":"Users with access to this company","type":"array","items":{"$ref":"#/components/schemas/CompanyUserDto"}}},"required":["data"]},"GrantCompanyAccessDto":{"type":"object","properties":{"accessLevel":{"type":"string","description":"Access level to grant","enum":["READ_ONLY","READ_WRITE","ADMIN"],"default":"READ_ONLY"}},"required":["accessLevel"]},"CompanyAccessResponseDto":{"type":"object","properties":{"id":{"type":"string","description":"Access record ID"},"userId":{"type":"string","description":"User ID"},"quickbooksConnectionId":{"type":"string","description":"QuickBooks connection ID"},"accessLevel":{"type":"string","description":"Access level"},"grantedAt":{"type":"string","description":"When access was granted"},"grantedBy":{"type":"string","description":"Who granted the access"}},"required":["id","userId","quickbooksConnectionId","accessLevel","grantedAt"]},"UpdateCompanyAccessDto":{"type":"object","properties":{"accessLevel":{"type":"string","description":"New access level","enum":["READ_ONLY","READ_WRITE","ADMIN"]}},"required":["accessLevel"]},"StatusCountDto":{"type":"object","properties":{"status":{"type":"string","example":"OPEN"},"count":{"type":"number","example":15}},"required":["status","count"]},"DocsProcessedDto":{"type":"object","properties":{"count":{"type":"number","example":550},"change":{"type":"number","example":0.1,"description":"Percentage change from the previous 24h period"}},"required":["count"]},"AwaitingApprovalDto":{"type":"object","properties":{"count":{"type":"number","example":7},"oldestAgeHours":{"type":"number","example":18.4,"description":"Age in hours of the oldest item awaiting this user approval"}},"required":["count","oldestAgeHours"]},"AccountantDashboardSummaryDto":{"type":"object","properties":{"matchBacklogCount":{"type":"number","description":"Count of unresolved match items needing accountant action","example":18},"openExceptionsCount":{"type":"number","description":"Count of unresolved exceptions","example":12},"staleExceptionsCount":{"type":"number","description":"Count of stale exceptions that are escalated, overdue, or aging","example":5},"awaitingVendorCount":{"type":"number","description":"Count of exceptions currently waiting on vendor input","example":3}},"required":["matchBacklogCount","openExceptionsCount","staleExceptionsCount","awaitingVendorCount"]},"DashboardSummaryDTO":{"type":"object","properties":{"matchesClearedRate":{"type":"number","example":0.85,"description":"Ratio of cleared matches to total matches"},"exceptionsByStatus":{"description":"Count of exceptions grouped by status","type":"array","items":{"$ref":"#/components/schemas/StatusCountDto"}},"matchesByStatus":{"description":"Count of matches grouped by status","type":"array","items":{"$ref":"#/components/schemas/StatusCountDto"}},"docsProcessedLast24h":{"description":"Count of documents processed in the last 24 hours and percentage change","allOf":[{"$ref":"#/components/schemas/DocsProcessedDto"}]},"monthEndReadinessScore":{"type":"number","description":"Month-end readiness score from 0 to 100","example":84},"exceptionsResolvedThisMonth":{"type":"number","description":"Number of exceptions resolved in the current month","example":42},"outstandingCriticalExceptions":{"type":"number","description":"Count of outstanding critical exceptions","example":5},"estimatedCloseTimeSavingsHours":{"type":"number","description":"Estimated close time savings in hours for this month","example":18.5},"awaitingMyApproval":{"description":"Invoices currently awaiting the signed-in user approval","allOf":[{"$ref":"#/components/schemas/AwaitingApprovalDto"}]},"accountant":{"description":"Additional accountant-focused metrics used to personalize dashboard home","allOf":[{"$ref":"#/components/schemas/AccountantDashboardSummaryDto"}]}},"required":["matchesClearedRate","exceptionsByStatus","matchesByStatus","docsProcessedLast24h","monthEndReadinessScore","exceptionsResolvedThisMonth","outstandingCriticalExceptions","estimatedCloseTimeSavingsHours","awaitingMyApproval","accountant"]},"GenerateWipReportDto":{"type":"object","properties":{}},"XeroTriggerSyncDto":{"type":"object","properties":{}},"FreshBooksAuthUrlResponse":{"type":"object","properties":{"authUrl":{"type":"string","description":"OAuth authorization URL"},"state":{"type":"string","description":"State parameter for CSRF protection"}},"required":["authUrl","state"]},"FreshBooksOAuthSuccessResponse":{"type":"object","properties":{"connectionId":{"type":"string","description":"FreshBooks connection ID"},"integrationId":{"type":"string","description":"Integration ID"},"freshbooksAccountId":{"type":"string","description":"FreshBooks account ID"},"accountId":{"type":"string","description":"Deprecated: use freshbooksAccountId"},"businessUuid":{"type":"string","description":"FreshBooks business UUID"},"businessName":{"type":"string","description":"FreshBooks business name"},"status":{"type":"string","description":"Connection status"},"message":{"type":"string","description":"Success message"},"requiresSelection":{"type":"boolean","description":"Whether the user must choose from multiple FreshBooks businesses before finishing the connection"},"selectionToken":{"type":"string","description":"Encrypted continuation token used to finalize the selected FreshBooks business"},"businesses":{"description":"Available FreshBooks businesses the user can connect","type":"array","items":{"type":"object"}}},"required":["integrationId","status","message"]},"FreshBooksCallbackDto":{"type":"object","properties":{"code":{"type":"string","description":"Authorization code from OAuth callback"},"state":{"type":"string","description":"State parameter from OAuth callback"},"freshbooksAccountId":{"type":"string","description":"FreshBooks account ID selected from multiple businesses"},"businessUuid":{"type":"string","description":"FreshBooks business UUID selected from multiple businesses"},"selectionToken":{"type":"string","description":"Encrypted continuation token for finalizing a multi-business FreshBooks selection"}},"required":["state"]},"FreshBooksConnectionResponse":{"type":"object","properties":{"id":{"type":"string","description":"FreshBooks connection ID"},"integrationId":{"type":"string","description":"Integration ID"},"freshbooksAccountId":{"type":"string","description":"FreshBooks account ID"},"accountId":{"type":"string","description":"Deprecated: use freshbooksAccountId"},"businessName":{"type":"string","description":"Business name from FreshBooks"},"status":{"type":"string","description":"Integration status"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"syncStatus":{"type":"string","description":"Current sync status"},"lastSyncError":{"type":"string","description":"Last sync error message"},"createdAt":{"type":"string","description":"Connection creation timestamp"}},"required":["id","integrationId","freshbooksAccountId","status","syncStatus","createdAt"]},"FreshBooksSyncStatusResponse":{"type":"object","properties":{"syncStatus":{"type":"string","description":"Current sync status"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"lastSyncError":{"type":"string","description":"Last sync error message"},"entityStats":{"type":"object","description":"Entity statistics"}},"required":["syncStatus","entityStats"]},"FreshBooksTriggerSyncDto":{"type":"object","properties":{"entityTypes":{"type":"array","description":"Entity types to sync","items":{"type":"string","enum":["CLIENT","BILL","EXPENSE","PAYMENT","ALL"]}},"fullSync":{"type":"boolean","description":"Force full sync (ignore lastSyncedAt)"}}},"FreshBooksTriggerSyncResponse":{"type":"object","properties":{"syncJobId":{"type":"string","description":"Sync job ID"},"queuedAt":{"type":"string","description":"Timestamp when sync was queued"},"status":{"type":"string","description":"Current status"}},"required":["syncJobId","queuedAt","status"]},"DisconnectFreshBooksDto":{"type":"object","properties":{"wipeData":{"type":"boolean","description":"Wipe all synced data when disconnecting"}}},"ZohoAuthUrlResponse":{"type":"object","properties":{"authUrl":{"type":"string","description":"OAuth authorization URL"},"state":{"type":"string","description":"State parameter for CSRF protection"}},"required":["authUrl","state"]},"ZohoOAuthSuccessResponse":{"type":"object","properties":{"integrationId":{"type":"string","description":"Integration ID"},"zohoOrganizationId":{"type":"string","description":"Zoho organization ID"},"organizationId":{"type":"string","description":"Deprecated: use zohoOrganizationId"},"dataCenter":{"type":"string","description":"Zoho data center region"},"status":{"type":"string","description":"Connection status"},"message":{"type":"string","description":"Success message"}},"required":["integrationId","zohoOrganizationId","dataCenter","status","message"]},"ZohoConnectionResponse":{"type":"object","properties":{"integrationId":{"type":"string","description":"Integration ID"},"zohoOrganizationId":{"type":"string","description":"Zoho organization ID"},"organizationId":{"type":"string","description":"Deprecated: use zohoOrganizationId"},"organizationName":{"type":"string","description":"Organization name from Zoho"},"dataCenter":{"type":"string","description":"Zoho data center region"},"dataCenterDomain":{"type":"string","description":"Data center domain"},"status":{"type":"string","description":"Integration status"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"syncStatus":{"type":"string","description":"Current sync status"},"lastSyncError":{"type":"string","description":"Last sync error message"},"createdAt":{"type":"string","description":"Connection creation timestamp"}},"required":["integrationId","zohoOrganizationId","dataCenter","status","syncStatus","createdAt"]},"ZohoSyncStatusResponse":{"type":"object","properties":{"syncStatus":{"type":"string","description":"Current sync status"},"lastSyncedAt":{"type":"string","description":"Last sync timestamp"},"lastSyncError":{"type":"string","description":"Last sync error message"},"entityStats":{"type":"object","description":"Entity statistics"}},"required":["syncStatus","entityStats"]},"TriggerZohoSyncDto":{"type":"object","properties":{"entityTypes":{"type":"array","description":"Entity types to sync","items":{"type":"string","enum":["CONTACT","BILL","PURCHASE_ORDER","PAYMENT","ALL"]}},"fullSync":{"type":"boolean","description":"Force full sync (ignore lastSyncedAt)"}}},"TriggerZohoSyncResponse":{"type":"object","properties":{"syncJobId":{"type":"string","description":"Sync job ID"},"queuedAt":{"type":"string","description":"Timestamp when sync was queued"},"status":{"type":"string","description":"Current status"}},"required":["syncJobId","queuedAt","status"]},"DisconnectZohoDto":{"type":"object","properties":{"wipeData":{"type":"boolean","description":"Wipe all synced data when disconnecting"}}},"BlogPostSummaryDto":{"type":"object","properties":{"slug":{"type":"string","description":"Post slug used in URLs"},"title":{"type":"string","description":"Post title"},"excerpt":{"type":"string","description":"Short excerpt of the post"},"publishedAt":{"type":"string","description":"Publish date (ISO 8601)"},"updatedAt":{"type":"string","description":"Last updated date (ISO 8601)"},"readingTimeMinutes":{"type":"number","description":"Estimated reading time in minutes"},"wordCount":{"type":"number","description":"Word count of the post"}},"required":["slug","title","excerpt","publishedAt","updatedAt","readingTimeMinutes","wordCount"]},"BlogFaqDto":{"type":"object","properties":{"question":{"type":"string","description":"FAQ question"},"answer":{"type":"string","description":"FAQ answer"}},"required":["question","answer"]},"BlogAuthorDto":{"type":"object","properties":{"name":{"type":"string","description":"Author display name"},"role":{"type":"string","description":"Author role or title","nullable":true}},"required":["name"]},"BlogPostDetailDto":{"type":"object","properties":{"slug":{"type":"string","description":"Post slug used in URLs"},"title":{"type":"string","description":"Post title"},"excerpt":{"type":"string","description":"Short excerpt of the post"},"publishedAt":{"type":"string","description":"Publish date (ISO 8601)"},"updatedAt":{"type":"string","description":"Last updated date (ISO 8601)"},"readingTimeMinutes":{"type":"number","description":"Estimated reading time in minutes"},"wordCount":{"type":"number","description":"Word count of the post"},"metaDescription":{"type":"string","description":"Meta description for SEO","nullable":true},"keywords":{"description":"SEO keyword targets","type":"array","items":{"type":"string"}},"category":{"type":"string","description":"Blog category used for CTA selection","nullable":true},"relatedSlugs":{"description":"Related blog slugs","type":"array","items":{"type":"string"}},"faq":{"description":"Frequently asked questions for the article","type":"array","items":{"$ref":"#/components/schemas/BlogFaqDto"}},"sourceUrl":{"type":"string","description":"Optional source URL for the original article","nullable":true},"structuredContent":{"type":"object","description":"Structured blog content blocks for component rendering","additionalProperties":true,"nullable":true},"author":{"description":"Named author of the post, when one is recorded","nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/BlogAuthorDto"}]}},"required":["slug","title","excerpt","publishedAt","updatedAt","readingTimeMinutes","wordCount","keywords","relatedSlugs","faq","structuredContent"]},"SsoSamlSettingsDto":{"type":"object","properties":{"status":{"type":"string","enum":["NOT_CONFIGURED","CONFIGURED","ACTIVE","ERROR"]},"provider":{"type":"string","enum":["OKTA","AZURE_AD","GOOGLE_WORKSPACE","ONELOGIN","PING_ID","CUSTOM","OTHER"]},"enabled":{"type":"boolean","description":"Whether SSO/SAML login is enabled."},"issuer":{"type":"string","description":"SAML issuer / entity ID."},"ssoUrl":{"type":"string","description":"Identity provider SSO URL."},"metadataUrl":{"type":"string","description":"Identity provider metadata URL."},"hasCertificate":{"type":"boolean","description":"Whether a signing certificate is currently stored."},"domains":{"description":"Email domains that should be routed through SSO.","type":"array","items":{"type":"string"}},"allowJitProvisioning":{"type":"boolean","description":"Allow just-in-time user provisioning on successful SSO login."},"enforceForAllUsers":{"type":"boolean","description":"Force SSO for all tenant users (except break-glass admins)."},"loginButtonText":{"type":"string","description":"Optional custom text for SSO login button."},"lastValidatedAt":{"type":"string","format":"date-time"},"lastValidationError":{"type":"string","description":"Last validation error message (if any)."},"canEdit":{"type":"boolean","description":"Whether current tenant plan can edit this feature."}},"required":["status","provider","enabled","hasCertificate","domains","allowJitProvisioning","enforceForAllUsers","canEdit"]},"UpdateSsoSamlSettingsDto":{"type":"object","properties":{"provider":{"type":"string","enum":["OKTA","AZURE_AD","GOOGLE_WORKSPACE","ONELOGIN","PING_ID","CUSTOM","OTHER"]},"enabled":{"type":"boolean","description":"Enable/disable SSO login."},"issuer":{"type":"string","description":"SAML issuer / entity ID."},"ssoUrl":{"type":"string","description":"SAML SSO URL."},"metadataUrl":{"type":"string","description":"SAML metadata URL."},"x509Certificate":{"type":"string","description":"X.509 certificate in PEM format. Leave undefined to keep existing value."},"domains":{"description":"Domains routed to SSO. Use base domain format (example.com).","type":"array","items":{"type":"string"}},"allowJitProvisioning":{"type":"boolean"},"enforceForAllUsers":{"type":"boolean"},"loginButtonText":{"type":"string","description":"Custom SSO button text.","maxLength":80},"clearCertificate":{"type":"boolean","description":"Set true to remove previously stored certificate when this request is saved.","default":false}}},"ValidateSsoSamlResponseDto":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether current configuration passed validation."},"status":{"type":"string","enum":["NOT_CONFIGURED","CONFIGURED","ACTIVE","ERROR"]},"errors":{"type":"array","items":{"type":"string"}},"validatedAt":{"type":"string","format":"date-time"}},"required":["isValid","status","errors","validatedAt"]},"CollectChaseEffectivenessDto":{"type":"object","properties":{"totalSent":{"type":"number"},"openRate":{"type":"number"},"replyRate":{"type":"number"},"paymentRate":{"type":"number"}},"required":["totalSent","openRate","replyRate","paymentRate"]},"CollectPredictedCashInflowDto":{"type":"object","properties":{"next30Days":{"type":"number"},"next60Days":{"type":"number"},"next90Days":{"type":"number"}},"required":["next30Days","next60Days","next90Days"]},"CollectDashboardResponseDto":{"type":"object","properties":{"totalOutstanding":{"type":"number"},"totalCurrent":{"type":"number"},"totalOverdue":{"type":"number"},"dso":{"type":"number"},"collectedThisMonth":{"type":"number"},"agingBuckets":{"type":"array","items":{"type":"string"}},"riskDistribution":{"type":"array","items":{"type":"string"}},"chaseEffectiveness":{"$ref":"#/components/schemas/CollectChaseEffectivenessDto"},"predictedCashInflow":{"$ref":"#/components/schemas/CollectPredictedCashInflowDto"},"customerCount":{"type":"number"},"invoiceCount":{"type":"number"}},"required":["totalOutstanding","totalCurrent","totalOverdue","dso","collectedThisMonth","agingBuckets","riskDistribution","chaseEffectiveness","predictedCashInflow","customerCount","invoiceCount"]},"TriggerCollectSyncDto":{"type":"object","properties":{"quickbooksConnectionId":{"type":"string","description":"QuickBooks connection ID to sync"},"fullSync":{"type":"boolean","description":"Whether to do a full re-sync"}}},"CollectSyncStatusResponseDto":{"type":"object","properties":{"status":{"type":"string"},"customersCount":{"type":"number"},"invoicesCount":{"type":"number"},"lastSyncedAt":{"type":"string"},"error":{"type":"string"}},"required":["status","customersCount","invoicesCount"]},"CreateChaseSequenceDto":{"type":"object","properties":{"invoiceId":{"type":"string"},"autoSendEnabled":{"type":"boolean","default":false}},"required":["invoiceId"]},"UpdateChaseSequenceDto":{"type":"object","properties":{"autoSendEnabled":{"type":"boolean"}},"required":["autoSendEnabled"]},"UpdateChaseStepDto":{"type":"object","properties":{"editedContent":{"type":"string"}}},"SendChaseStepDto":{"type":"object","properties":{"editedContent":{"type":"string","description":"Override content for this send"}}},"CollectSettingsResponseDto":{"type":"object","properties":{"reminderDaysBefore":{"type":"number"},"step1DaysAfter":{"type":"number"},"step2DaysAfter":{"type":"number"},"step3DaysAfter":{"type":"number"},"step4DaysAfter":{"type":"number"},"tone":{"type":"string"},"companyName":{"type":"string"},"includePaymentLink":{"type":"boolean"},"autoSendEnabled":{"type":"boolean"},"predictionEnabled":{"type":"boolean"},"reScoringFrequency":{"type":"string"},"fromName":{"type":"string"},"replyToEmail":{"type":"string"},"emailSignature":{"type":"string"}},"required":["reminderDaysBefore","step1DaysAfter","step2DaysAfter","step3DaysAfter","step4DaysAfter","tone","includePaymentLink","autoSendEnabled","predictionEnabled","reScoringFrequency"]},"UpdateCollectSettingsDto":{"type":"object","properties":{"reminderDaysBefore":{"type":"number"},"step1DaysAfter":{"type":"number"},"step2DaysAfter":{"type":"number"},"step3DaysAfter":{"type":"number"},"step4DaysAfter":{"type":"number"},"tone":{"type":"string"},"companyName":{"type":"string"},"includePaymentLink":{"type":"boolean"},"autoSendEnabled":{"type":"boolean"},"predictionEnabled":{"type":"boolean"},"reScoringFrequency":{"type":"string"},"fromName":{"type":"string"},"replyToEmail":{"type":"string"},"emailSignature":{"type":"string"}}},"UpdateForecastSettingsDto":{"type":"object","properties":{"horizonDays":{"type":"number","description":"Forecast horizon in days","example":90},"minimumCashThreshold":{"type":"number","description":"Minimum cash threshold for low-cash alerts","example":5000},"alertsEnabled":{"type":"boolean","description":"Enable/disable alerts"},"weeklyDigestEnabled":{"type":"boolean","description":"Enable/disable weekly digest email"},"weeklyDigestDay":{"type":"number","description":"Day of week for weekly digest (0=Sun, 1=Mon, ...)","example":1},"openingCashBalance":{"type":"number","description":"Opening cash balance used only when no QuickBooks Online bank balance is available. Send null to clear.","example":42000,"nullable":true},"openingCashBalanceAsOf":{"type":"string","description":"Date the opening cash balance is as of (YYYY-MM-DD)","example":"2026-10-23","nullable":true}}},"CreateRecurringTransactionDto":{"type":"object","properties":{"name":{"type":"string","description":"Transaction name","example":"Office Rent"},"type":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":"number","description":"Transaction amount","example":3500},"frequency":{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","ANNUAL"]},"nextDueDate":{"type":"string","description":"Next due date (YYYY-MM-DD)","example":"2026-03-01"},"dayOfMonth":{"type":"number","description":"Day of month (1-31) for monthly"},"dayOfWeek":{"type":"number","description":"Day of week (0=Sun, 1=Mon)"},"category":{"type":"string","description":"Category/GL code"},"counterparty":{"type":"string","description":"Customer or vendor name"}},"required":["name","type","amount","frequency","nextDueDate"]},"UpdateRecurringTransactionDto":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["INFLOW","OUTFLOW"]},"amount":{"type":"number"},"frequency":{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","ANNUAL"]},"nextDueDate":{"type":"string"},"dayOfMonth":{"type":"number"},"dayOfWeek":{"type":"number"},"category":{"type":"string"},"counterparty":{"type":"string"},"isConfirmed":{"type":"boolean"},"isActive":{"type":"boolean"}}},"CreateScenarioDto":{"type":"object","properties":{"query":{"type":"string","description":"Natural language question","example":"What happens if Client X pays 30 days late?"},"name":{"type":"string","description":"Scenario name"}},"required":["query"]},"DismissAlertDto":{"type":"object","properties":{"isDismissed":{"type":"boolean"},"isRead":{"type":"boolean"}}},"TriggerAuditScanDto":{"type":"object","properties":{"quickbooksConnectionId":{"type":"string","description":"QuickBooks connection ID to scan"},"fullScan":{"type":"boolean","description":"Run full scan instead of incremental","default":false}},"required":["quickbooksConnectionId"]},"UpdateFindingStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"New status for the finding","enum":["NEW","REVIEWING","CONFIRMED","FALSE_POSITIVE","INVESTIGATING"]}},"required":["status"]},"SubmitFindingFeedbackDto":{"type":"object","properties":{"isUseful":{"type":"boolean","description":"Whether the finding was useful"},"reason":{"type":"string","description":"Reason for marking as not useful"}},"required":["isUseful"]},"BulkUpdateFindingStatusDto":{"type":"object","properties":{"findingIds":{"description":"Finding IDs to update","type":"array","items":{"type":"string"}},"status":{"type":"string","description":"New status for all findings","enum":["NEW","REVIEWING","CONFIRMED","FALSE_POSITIVE","INVESTIGATING"]}},"required":["findingIds","status"]},"GenerateAuditReportDto":{"type":"object","properties":{"quickbooksConnectionId":{"type":"string","description":"QuickBooks connection ID"},"periodStart":{"type":"string","description":"Report period start date"},"periodEnd":{"type":"string","description":"Report period end date"},"title":{"type":"string","description":"Custom report title"}},"required":["quickbooksConnectionId"]},"UpdateAuditSettingsDto":{"type":"object","properties":{"duplicateDetectionEnabled":{"type":"boolean","description":"Enable duplicate payment detection"},"unusualAmountEnabled":{"type":"boolean","description":"Enable unusual amount detection"},"roundNumberEnabled":{"type":"boolean","description":"Enable round number flagging"},"newVendorEnabled":{"type":"boolean","description":"Enable new vendor detection"},"dormantVendorEnabled":{"type":"boolean","description":"Enable dormant vendor detection"},"categorizationErrorEnabled":{"type":"boolean","description":"Enable categorization error detection"},"unusualAmountZScoreThreshold":{"type":"number","description":"Z-score threshold for unusual amount detection","example":2.5},"roundNumberThreshold":{"type":"number","description":"Minimum amount to flag round numbers","example":1000},"dormantVendorDays":{"type":"number","description":"Days of vendor inactivity before flagging","example":180},"duplicateAmountTolerancePct":{"type":"number","description":"Percentage tolerance for duplicate amount matching","example":1},"duplicateDateWindowDays":{"type":"number","description":"Date window in days for duplicate detection","example":30},"emailOnHighSeverity":{"type":"boolean","description":"Send email alerts on high severity findings"},"autoScanAfterSync":{"type":"boolean","description":"Automatically run scan after QBO sync"},"scheduledScanEnabled":{"type":"boolean","description":"Run a scheduled scan of each connected company, independent of QBO syncs"},"scheduledScanIntervalHours":{"type":"number","description":"Hours between scheduled scans of each connected company","example":24},"firmName":{"type":"string","description":"Firm name for report branding"},"firmLogoUrl":{"type":"string","description":"Firm logo URL for report branding"}}},"CreateJobDto":{"type":"object","properties":{}},"CreateJobPhaseDto":{"type":"object","properties":{}},"UpdateJobPhaseDto":{"type":"object","properties":{}},"UpdateJobDto":{"type":"object","properties":{}},"CreateSovDto":{"type":"object","properties":{}},"SovLineItemDto":{"type":"object","properties":{}},"ReplaceSovLinesDto":{"type":"object","properties":{}},"CreatePayApplicationDto":{"type":"object","properties":{}},"UpdatePayAppLinesDto":{"type":"object","properties":{}},"CreateRetentionHoldDto":{"type":"object","properties":{}},"ReleaseRetentionDto":{"type":"object","properties":{}},"CancelReleaseRequestDto":{"type":"object","properties":{}},"ReverseRetentionReleaseDto":{"type":"object","properties":{}},"MarkRetentionReleasePaidDto":{"type":"object","properties":{}},"CreateRetainageScheduleDto":{"type":"object","properties":{}},"CreateSubcontractDto":{"type":"object","properties":{}},"UpdateSubcontractDto":{"type":"object","properties":{}},"CreateChangeOrderDto":{"type":"object","properties":{}},"UpdateChangeOrderDto":{"type":"object","properties":{}},"CreateCostCodeDto":{"type":"object","properties":{}},"AutoAssignCostCodeDto":{"type":"object","properties":{}},"CreateCostTypeDto":{"type":"object","properties":{}},"UpdateCostTypeDto":{"type":"object","properties":{}},"UpdateCostCodeDto":{"type":"object","properties":{}},"CreateInsuranceCertDto":{"type":"object","properties":{}},"CreateInsuranceRequirementDto":{"type":"object","properties":{}},"UpdateInsuranceCertDto":{"type":"object","properties":{}},"AutonomousAgentSettingsDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether autonomous exception resolution is enabled."},"confidenceThresholdPct":{"type":"number","description":"Confidence score required before the agent can auto-resolve an exception.","minimum":1,"maximum":100,"default":70},"minExceptionAgeMinutes":{"type":"number","description":"Minimum exception age in minutes before the agent can evaluate it.","minimum":1,"maximum":10080,"default":60},"maxResolutionsPerRun":{"type":"number","description":"Max exceptions the agent can resolve in a single run.","minimum":1,"maximum":200,"default":25},"requireSupplierSignal":{"type":"boolean","description":"If enabled, supplier engagement signal (email response/acknowledgement) is required before auto-resolution.","default":true},"notifyOnResolution":{"type":"boolean","description":"If enabled, sends a post-run alert when auto-resolutions happen.","default":true},"lastRunAt":{"type":"string","description":"ISO timestamp of the last completed run.","format":"date-time"},"targetAutoResolvePct":{"type":"number","description":"Plan-based target used in pricing copy (Starter/Team=50, Growth=65, Enterprise=70).","minimum":50,"maximum":70}},"required":["enabled","confidenceThresholdPct","minExceptionAgeMinutes","maxResolutionsPerRun","requireSupplierSignal","notifyOnResolution","targetAutoResolvePct"]},"UpdateAutonomousAgentSettingsDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enable or disable autonomous resolution."},"confidenceThresholdPct":{"type":"number","minimum":1,"maximum":100},"minExceptionAgeMinutes":{"type":"number","minimum":1,"maximum":10080},"maxResolutionsPerRun":{"type":"number","minimum":1,"maximum":200},"requireSupplierSignal":{"type":"boolean"},"notifyOnResolution":{"type":"boolean"}}},"AutonomousAgentRunRecordDto":{"type":"object","properties":{"id":{"type":"string","description":"Run identifier."},"trigger":{"type":"string","enum":["MANUAL","SCHEDULED"]},"startedAt":{"type":"string","format":"date-time"},"finishedAt":{"type":"string","format":"date-time"},"processedCount":{"type":"number"},"resolvedCount":{"type":"number"},"skippedCount":{"type":"number"},"averageConfidencePct":{"type":"number"},"errorMessage":{"type":"string"}},"required":["id","trigger","startedAt","processedCount","resolvedCount","skippedCount"]},"AutonomousAgentRunListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AutonomousAgentRunRecordDto"}}},"required":["data"]},"RunAutonomousAgentDto":{"type":"object","properties":{"force":{"type":"boolean","description":"Force a run even when the agent is disabled in settings.","default":false}}},"AutonomousAgentRunSummaryDto":{"type":"object","properties":{"trigger":{"type":"string","enum":["MANUAL","SCHEDULED"]},"processedCount":{"type":"number","description":"Total candidate exceptions inspected."},"resolvedCount":{"type":"number","description":"Number of exceptions auto-resolved in this run."},"skippedCount":{"type":"number","description":"Candidates skipped due to safeguards/thresholds."},"averageConfidencePct":{"type":"number","description":"Average confidence across resolved exceptions."},"status":{"type":"string","description":"Machine-readable run status for UI handling.","example":"completed"},"message":{"type":"string","description":"Human-readable summary."},"finishedAt":{"type":"string","description":"Run completion timestamp.","format":"date-time"}},"required":["trigger","processedCount","resolvedCount","skippedCount","status","message","finishedAt"]},"InvokeAgentDto":{"type":"object","properties":{}},"LegalEntityDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Acme UK Underwriting Ltd"},"code":{"type":"string","example":"UK"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","code","createdAt","updatedAt"]},"LegalEntityListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegalEntityDto"}}},"required":["data"]},"UpsertLegalEntityDto":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable legal entity name.","example":"Acme UK Underwriting Ltd"},"code":{"type":"string","description":"Short code used to identify the entity (e.g. UK, EU, US). Unique per tenant.","example":"UK"}},"required":["name","code"]},"BranchDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","example":"Spanish Fork"},"code":{"type":"string","example":"SF"},"quickbooksClassId":{"type":"string","nullable":true,"description":"QuickBooks Online Class Id bills for this branch carry."},"quickbooksClassName":{"type":"string","nullable":true},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","code","isActive","createdAt","updatedAt"]},"BranchListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BranchDto"}}},"required":["data"]},"BranchSpendAccountDto":{"type":"object","properties":{"account":{"type":"string","example":"5000 - Parts"},"amount":{"type":"number"}},"required":["account","amount"]},"BranchSpendRowDto":{"type":"object","properties":{"branchId":{"type":"string","nullable":true,"description":"Null for bills not yet tagged to a branch."},"branchName":{"type":"string","example":"Provo"},"billCount":{"type":"number"},"totalAmount":{"type":"number","description":"Net of credit memos."},"creditCount":{"type":"number"},"pendingApprovalCount":{"type":"number"},"approvedCount":{"type":"number"},"syncedCount":{"type":"number","description":"Bills acknowledged by the accounting system."},"duplicateCount":{"type":"number","description":"Resent copies of a bill already counted (same vendor, invoice number and total); excluded from the totals."},"topAccounts":{"type":"array","items":{"$ref":"#/components/schemas/BranchSpendAccountDto"}}},"required":["branchName","billCount","totalAmount","creditCount","pendingApprovalCount","approvedCount","syncedCount","duplicateCount","topAccounts"]},"BranchSpendSummaryDto":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"truncated":{"type":"boolean","description":"True when the period held more invoices than the summary reads; totals then cover only the oldest ones."},"data":{"type":"array","items":{"$ref":"#/components/schemas/BranchSpendRowDto"}}},"required":["from","to","truncated","data"]},"UpsertBranchDto":{"type":"object","properties":{"name":{"type":"string","description":"Branch or location name.","example":"Provo"},"code":{"type":"string","description":"Short code for the branch. Unique per tenant.","example":"PV"},"quickbooksClassId":{"type":"string","nullable":true,"description":"QuickBooks Online Class Id to tag this branch’s bills with."},"quickbooksClassName":{"type":"string","nullable":true},"isActive":{"type":"boolean"}},"required":["name","code"]},"ProfileResponseDto":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"fullName":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"preferredLanguage":{"type":"string","example":"en-US"},"workspaceRole":{"type":"string","enum":["OWNER","ADMIN","MEMBER"],"nullable":true},"permissions":{"type":"array","items":{"type":"string"}},"membershipStatus":{"type":"string","enum":["active","inactive","removed","pending"],"nullable":true},"tenantId":{"type":"string","nullable":true},"organizationId":{"type":"string","nullable":true}},"required":["id","email","fullName","preferredLanguage","permissions"]},"UpdateProfileDto":{"type":"object","properties":{"fullName":{"type":"string","description":"User full name","example":"Ademola Afolabi"},"phoneNumber":{"type":"string","description":"User phone number. Stores display value as entered by the user.","example":"+1 555 123 4567","nullable":true},"preferredLanguage":{"type":"string","description":"Preferred language/locale code","example":"en-US"}},"required":["fullName","preferredLanguage"]},"SavedViewDto":{"type":"object","properties":{"id":{"type":"string","description":"Stable id for the saved view."},"label":{"type":"string","description":"Display label for the saved view."},"route":{"type":"string","description":"Route path the saved view applies to.","example":"/operations/exceptions"},"query":{"type":"object","description":"Query params to apply for this view."}},"required":["id","label","route"]},"RecentRecordDto":{"type":"object","properties":{"id":{"type":"string","description":"Stable record id with type prefix."},"type":{"type":"string","enum":["invoice","vendor","report","job","dashboard"]},"label":{"type":"string","description":"Hydrated display label."},"href":{"type":"string","description":"Record route."},"lastViewedAt":{"type":"string","format":"date-time"},"pinnedAt":{"type":"string","format":"date-time"}},"required":["id","type","label","href","lastViewedAt"]},"PersonalizationSettingsDto":{"type":"object","properties":{"workflowPersona":{"type":"string","description":"Workflow persona used to tailor the UI.","enum":["GENERAL","AP_CLERK","ACCOUNTANT","CONTROLLER","APPROVER"],"default":"GENERAL"},"workflowPersonaSource":{"type":"string","description":"Whether the current workflow persona is explicitly chosen by the user or inferred from role data.","enum":["MANUAL","INFERRED"],"default":"INFERRED"},"workspaceApp":{"type":"string","description":"Product the active workspace was created for (lowercase slug, e.g. 'build'); null when unknown.","nullable":true},"inferredWorkflowPersona":{"type":"string","description":"The current inferred workflow persona based on app role and approval-role assignments.","enum":["GENERAL","AP_CLERK","ACCOUNTANT","CONTROLLER","APPROVER"]},"defaultLandingPath":{"type":"string","description":"Default landing route after sign-in.","example":"/"},"compactNav":{"type":"boolean","description":"Render compact sidebar navigation.","default":false},"savedViews":{"description":"User saved views for quick access.","type":"array","items":{"$ref":"#/components/schemas/SavedViewDto"}},"recentRecords":{"description":"Synced recent and pinned navigation records.","type":"array","items":{"$ref":"#/components/schemas/RecentRecordDto"}},"defaultFilters":{"type":"object","description":"Per-route default filter objects."}},"required":["workflowPersona","workflowPersonaSource","defaultLandingPath","compactNav","savedViews","recentRecords"]},"UpdatePersonalizationSettingsDto":{"type":"object","properties":{"workflowPersona":{"type":"string","description":"Workflow persona used to tailor the UI.","enum":["GENERAL","AP_CLERK","ACCOUNTANT","CONTROLLER","APPROVER"],"default":"GENERAL"},"workflowPersonaSource":{"type":"string","description":"Whether to keep the workflow persona manually selected or allow inference from role data.","enum":["MANUAL","INFERRED"]},"defaultLandingPath":{"type":"string","description":"Default landing route after sign-in."},"compactNav":{"type":"boolean","description":"Render compact sidebar navigation."},"savedViews":{"type":"array","items":{"$ref":"#/components/schemas/SavedViewDto"}},"recentRecords":{"type":"array","items":{"$ref":"#/components/schemas/RecentRecordDto"}},"defaultFilters":{"type":"object"}}},"UpdateNotificationPreferencesDto":{"type":"object","properties":{}},"EventNotificationSettingDto":{"type":"object","properties":{"event":{"type":"string","enum":["MATCH_CLEARED","EXCEPTION_CREATED","EXCEPTION_RESOLVED","DAILY_SUMMARY","DOCUMENT_PROCESSED","DOCUMENT_UPLOADED"]},"channels":{"type":"array","items":{"type":"string","enum":["EMAIL","SLACK","WEBHOOK"]}},"deliveryFrequency":{"type":"string","enum":["IMMEDIATE","DAILY_DIGEST"],"default":"DAILY_DIGEST"}},"required":["event","channels"]},"NotificationSettingsDto":{"type":"object","properties":{"defaultChannels":{"type":"array","items":{"type":"string","enum":["EMAIL","SLACK","WEBHOOK"]}},"eventSettings":{"type":"array","items":{"$ref":"#/components/schemas/EventNotificationSettingDto"}}},"required":["defaultChannels","eventSettings"]},"UpdateNotificationSettingsDto":{"type":"object","properties":{"defaultChannels":{"type":"array","items":{"type":"string","enum":["EMAIL","SLACK","WEBHOOK"]}},"eventSettings":{"type":"array","items":{"$ref":"#/components/schemas/EventNotificationSettingDto"}}},"required":["defaultChannels","eventSettings"]},"NotificationSlackDestinationDto":{"type":"object","properties":{"webhookUrl":{"type":"string","nullable":true},"channelLabel":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["active"]},"UpdateNotificationSlackDestinationDto":{"type":"object","properties":{"webhookUrl":{"type":"string"},"channelLabel":{"type":"string"},"active":{"type":"boolean"}}},"ProfileNotificationPreferencesDto":{"type":"object","properties":{"emailUpdates":{"type":"boolean"},"pushNotifications":{"type":"boolean"},"weeklyReports":{"type":"boolean"},"securityAlerts":{"type":"boolean"}},"required":["emailUpdates","pushNotifications","weeklyReports","securityAlerts"]},"UpdateProfileNotificationPreferencesDto":{"type":"object","properties":{"emailUpdates":{"type":"boolean"},"pushNotifications":{"type":"boolean"},"weeklyReports":{"type":"boolean"},"securityAlerts":{"type":"boolean"}}},"PushSubscriptionDto":{"type":"object","properties":{"id":{"type":"string"},"endpoint":{"type":"string"},"userAgent":{"type":"string"},"lastSeenAt":{"type":"string"},"disabledAt":{"type":"string"}},"required":["id","endpoint","lastSeenAt"]},"PushSubscriptionListDto":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/PushSubscriptionDto"}},"vapidPublicKey":{"type":"string"}},"required":["subscriptions"]},"CreatePushSubscriptionDto":{"type":"object","properties":{"endpoint":{"type":"string"},"p256dh":{"type":"string"},"auth":{"type":"string"},"userAgent":{"type":"string"}},"required":["endpoint","p256dh","auth"]},"NotificationCenterItemDto":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["approvals","comments","failed-exports","sla","delegations","integrations"]},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["critical","warning","info","success"]},"kind":{"type":"string","enum":["EMAIL_UPDATE","WEEKLY_REPORT","SECURITY_ALERT"]},"channel":{"type":"string","enum":["EMAIL","PUSH"]},"deliveryStatus":{"type":"string","enum":["QUEUED","PROCESSING","SENT","SKIPPED","FAILED"]},"status":{"type":"string"},"createdAt":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"queuedAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"failedAt":{"type":"string","nullable":true},"readAt":{"type":"string","nullable":true},"dismissedAt":{"type":"string","nullable":true},"href":{"type":"string","nullable":true},"actionLabel":{"type":"string"},"isRead":{"type":"boolean"}},"required":["id","category","title","description","severity","kind","channel","deliveryStatus","status","createdAt","occurredAt","queuedAt","sentAt","failedAt","readAt","dismissedAt","href","actionLabel","isRead"]},"NotificationCenterSummaryDto":{"type":"object","properties":{"total":{"type":"number"},"unread":{"type":"number"},"urgent":{"type":"number"}},"required":["total","unread","urgent"]},"NotificationCenterListDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/NotificationCenterItemDto"}},"summary":{"$ref":"#/components/schemas/NotificationCenterSummaryDto"}},"required":["data","summary"]},"ApiKeyDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"revokedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","keyPrefix","permissions","createdAt"]},"ApiKeyListResponseDto":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyDto"}}},"required":["data"]},"CreateApiKeyDto":{"type":"object","properties":{"name":{"type":"string","description":"Display name for the API key."},"permissions":{"type":"array","description":"Permission scopes granted to the API key. Use granular scopes (e.g. \"documents:read\") or wildcards (\"read\", \"write\").","default":["read","write"],"items":{"type":"string","enum":["read","write","documents:read","documents:write","purchase-orders:read","purchase-orders:write","matches:read","matches:write","exceptions:read","exceptions:write","suppliers:read","webhooks:read","webhooks:write"]}},"expiresAt":{"type":"string","description":"Optional expiry timestamp for the key.","format":"date-time"}},"required":["name"]},"CreateApiKeyResponseDto":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKeyDto"},"plainTextKey":{"type":"string","description":"Full secret API key value. This is only returned once."}},"required":["apiKey","plainTextKey"]},"ExceptionSlaRuleDto":{"type":"object","properties":{"key":{"type":"string","description":"Exception type or severity key."},"dueHours":{"type":"number","description":"Base due window in hours."}},"required":["key","dueHours"]},"ApprovalEscalationSettingsDto":{"type":"object","properties":{"reminderAfterHours":{"type":"number"},"escalateAfterHours":{"type":"number"},"maxReminders":{"type":"number"},"targetRole":{"type":"string"}},"required":["reminderAfterHours","escalateAfterHours","maxReminders","targetRole"]},"SlaSettingsDto":{"type":"object","properties":{"exceptionDefaults":{"type":"array","items":{"$ref":"#/components/schemas/ExceptionSlaRuleDto"}},"approvalEscalation":{"$ref":"#/components/schemas/ApprovalEscalationSettingsDto"},"canEdit":{"type":"boolean","description":"Whether the plan allows editing these values."}},"required":["exceptionDefaults","approvalEscalation","canEdit"]},"UpdateSlaSettingsDto":{"type":"object","properties":{"exceptionDefaults":{"type":"array","items":{"$ref":"#/components/schemas/ExceptionSlaRuleDto"}},"approvalEscalation":{"$ref":"#/components/schemas/ApprovalEscalationSettingsDto"}}},"UpdateVendorTaxDto":{"type":"object","properties":{}},"Generate1099sDto":{"type":"object","properties":{}},"CreateProcoreEmbeddedHandoffDto":{"type":"object","properties":{"procoreCompanyId":{"type":"string","description":"Procore company id the embedded panel was opened for ({{procore.company.id}}). Bound into the code; access is still decided server-side against the tenant connection.","example":"562949953421312"}},"required":["procoreCompanyId"]},"ProcoreEmbeddedHandoffResponse":{"type":"object","properties":{"code":{"type":"string","description":"Single-use handoff code (2-minute TTL)."},"expiresAt":{"type":"string"}},"required":["code","expiresAt"]},"ExchangeProcoreEmbeddedHandoffDto":{"type":"object","properties":{"code":{"type":"string","description":"Single-use handoff code from the sign-in popup."}},"required":["code"]},"ProcoreEmbeddedSessionResponse":{"type":"object","properties":{"token":{"type":"string","description":"Embedded session bearer token (10-minute TTL, read-only endpoints only). Keep in memory; never persist."},"expiresAt":{"type":"string"},"procoreCompanyId":{"type":"string"}},"required":["token","expiresAt","procoreCompanyId"]},"ProcoreEmbeddedOverviewResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok","company_not_connected"]},"projects":{"type":"array","items":{"type":"object"}}},"required":["status","projects"]},"ProcoreEmbeddedProjectSummaryResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok","company_not_connected","project_not_synced"]},"job":{"type":"object"},"invoicesAwaitingApproval":{"type":"object"},"retention":{"type":"object"},"lienWaivers":{"type":"object"},"compliance":{"type":"object"}},"required":["status"]},"CreateWageRequirementDto":{"type":"object","properties":{}},"CreateCertifiedPayrollDto":{"type":"object","properties":{}},"CreateBuildVendorDto":{"type":"object","properties":{}},"UpdateBuildInvoiceDto":{"type":"object","properties":{}},"InitiatePaymentDto":{"type":"object","properties":{"documentId":{"type":"string","description":"ID of the document (invoice) to pay"},"method":{"type":"string","enum":["ACH","WIRE","VIRTUAL_CARD","CHECK"],"description":"Payment method to use. Falls back to vendor default or tenant default."},"remittanceEmail":{"type":"string","description":"Remittance advice email. Falls back to supplier contact email."}},"required":["documentId"]},"UpdatePaymentConfigDto":{"type":"object","properties":{"isPaymentsEnabled":{"type":"boolean","description":"Enable/disable payments for tenant"},"defaultPaymentMethod":{"type":"string","enum":["ACH","WIRE","VIRTUAL_CARD","CHECK"],"description":"Default payment method for new vendors"},"autoPayOnApproval":{"type":"boolean","description":"Auto-pay invoices when approved"}}},"AddPaymentMethodDto":{"type":"object","properties":{"method":{"type":"string","enum":["ACH","WIRE","VIRTUAL_CARD","CHECK"],"description":"Payment method type"},"bankName":{"type":"string","description":"Bank name (for ACH/Wire)"},"routingNumber":{"type":"string","description":"Routing number (for ACH). Validated but not stored raw."},"accountNumber":{"type":"string","description":"Account number (for ACH/Wire). Only last 4 digits stored."},"isDefault":{"type":"boolean","description":"Set as default payment method for this vendor","default":true}},"required":["method"]},"CompleteFinancialConnectionDto":{"type":"object","properties":{"connectionAccountId":{"type":"string","description":"Stripe Financial Connection account ID"}},"required":["connectionAccountId"]},"SetDefaultMethodDto":{"type":"object","properties":{"method":{"type":"string","enum":["ACH","WIRE","VIRTUAL_CARD","CHECK"],"description":"Payment method to set as default"}},"required":["method"]},"CommandSearchResultDto":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"href":{"type":"string"},"kind":{"type":"string","enum":["record","action","report"]},"icon":{"type":"string"},"status":{"type":"string"}},"required":["id","title","description","href","kind","icon"]},"CommandSearchGroupDto":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CommandSearchResultDto"}}},"required":["id","label","items"]},"CommandSearchResponseDto":{"type":"object","properties":{"query":{"type":"string"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/CommandSearchGroupDto"}}},"required":["query","groups"]},"CollaborationCommentResponseDto":{"type":"object","properties":{"id":{"type":"string"},"author":{"type":"string"},"body":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"type":"string","enum":["api"]}},"required":["id","author","body","createdAt","source"]},"CreateCollaborationCommentDto":{"type":"object","properties":{"contextType":{"type":"string","enum":["document","payments","reports"]},"contextId":{"type":"string"},"body":{"type":"string","maxLength":500},"mentions":{"type":"array","items":{"type":"string"}}},"required":["contextType","contextId","body"]}}}}