{"openapi":"3.1.0","info":{"title":"DutyClaims Partner API","version":"1.0.0","description":"External API for partner organizations, managed credentials, webhook operations, OAuth scaffolding, and diligence read access."},"servers":[{"url":"https://api.dutyclaims.com","description":"Current environment"}],"components":{"securitySchemes":{"BearerApiKey":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Managed broker API key issued through the DutyClaims broker or admin UI."},"XApiKey":{"type":"apiKey","in":"header","name":"X-API-Key"},"OAuthBearer":{"type":"http","scheme":"bearer","bearerFormat":"Opaque access token","description":"OAuth client-credentials bearer token for sandbox partner integrations."}},"schemas":{"Problem":{"type":"object","required":["type","title","status","detail","requestId","error"],"properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"requestId":{"type":"string"},"correlationId":{"type":"string"},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"}}}},"retryAfterMinutes":{"type":"integer"}}},"BulkJobStatus":{"type":"object","required":["jobId","portfolioId","status","sellerName","completenessStatus","entryCount","currentStage","processedCount","totalCount","progressPct","resumeEligible","createdAt"],"properties":{"jobId":{"type":"string"},"portfolioId":{"type":"string"},"status":{"type":"string","enum":["queued","running","partial","failed","completed"]},"sellerName":{"type":"string"},"completenessStatus":{"type":"string"},"entryCount":{"type":"integer"},"currentStage":{"type":"string"},"processedCount":{"type":"integer"},"totalCount":{"type":"integer"},"progressPct":{"type":"integer"},"errorSummary":{"type":["string","null"]},"resumeEligible":{"type":"boolean"},"checkpoint":{"type":["object","null"]},"submittedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"failedAt":{"type":["string","null"],"format":"date-time"}}},"DiligenceReport":{"type":"object","description":"Typed diligence report payload. RF8 appears only as the read-only rf8Review report state; the public API does not expose standalone RF8 source-configuration or source-management routes.","required":["jobId","portfolioId","sellerName","entryCount","entries"],"properties":{"jobId":{"type":"string"},"portfolioId":{"type":"string"},"sellerName":{"type":"string"},"diligenceDate":{"type":["string","null"]},"entryCount":{"type":"integer"},"valuationSummary":{"type":"object"},"rf8Review":{"type":["object","null"],"description":"Read-only RF8 report state. Use this object to understand whether Red Flag 8 import-history review is unresolved, pending, or cleared. This is contract-level outcome data only, not a public RF8 source-management surface.","required":["status","detail"],"properties":{"status":{"type":"string","enum":["not_started","pending","resolved"],"description":"Current RF8 review state in the diligence workflow."},"detail":{"type":"string","description":"Human-readable RF8 status detail suitable for partner dashboards or analyst handoff."},"sourceType":{"type":["string","null"],"enum":["approved_external_source","sop_manual_search","seller_provided_evidence","government_record","other",null],"description":"Normalized provenance category for the evidence behind the current RF8 state. This is descriptive metadata only, not a public source-selection endpoint."},"outcome":{"type":["string","null"],"enum":["history_confirmed","no_history_found","unable_to_verify","ambiguous_match",null],"description":"Outcome of the most recent RF8 review or automated verification attempt when one has been recorded."},"reviewedAt":{"type":["string","null"],"format":"date-time","description":"Timestamp of the evidence or verification event backing the current RF8 state."},"decisionMode":{"type":["string","null"],"enum":["automated","manual_review","manual_override",null],"description":"How the current RF8 state was established: automated approved-source lookup, analyst review still pending, or explicit analyst override."},"automatedClearance":{"type":["boolean","null"],"description":"True only when RF8 was cleared automatically from an approved external source match. False or null means the state was not auto-cleared."}},"additionalProperties":false},"entries":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"DiligenceDatasetJson":{"type":"object","required":["jobId","portfolioId","entries"],"properties":{"jobId":{"type":"string"},"portfolioId":{"type":"string"},"entries":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"DiligenceSubmissionAccepted":{"type":"object","required":["jobId","portfolioId","uploadedCount","estimatedEntryCount","uploadWarnings","message"],"properties":{"jobId":{"type":"string"},"portfolioId":{"type":"string"},"uploadedCount":{"type":"integer"},"estimatedEntryCount":{"type":"integer"},"warning":{"type":["string","null"]},"uploadWarnings":{"type":"array","items":{"type":"string"}},"message":{"type":"string"}}},"DiligenceResumeAccepted":{"type":"object","required":["jobId","resumed"],"properties":{"jobId":{"type":"string"},"resumed":{"type":"boolean","enum":[true]}}},"PartnerOrganization":{"type":"object","required":["id","displayName","partnerType","status","environment","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"externalPartnerId":{"type":["string","null"]},"displayName":{"type":"string"},"partnerType":{"type":"string","enum":["broker","saas_partner","forwarder_or_tms","service_provider"]},"status":{"type":"string","enum":["pending_review","active","suspended","revoked"]},"environment":{"type":"string","enum":["sandbox","production"]},"brokerId":{"type":["string","null"],"format":"uuid"},"createdByUserId":{"type":["string","null"]},"sandboxApprovedAt":{"type":["string","null"],"format":"date-time"},"productionPromotedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"PartnerCapability":{"type":"object","required":["partnerOrgId","canReadDiligence","canSubmitDiligence","canRequestFinancing","canEnrollLitigation","canUseAuthorityShortcuts","canManageWebhooks","notificationMode","diligenceMode","counterpartyDiligenceMode","updatedAt"],"properties":{"partnerOrgId":{"type":"string","format":"uuid"},"canReadDiligence":{"type":"boolean"},"canSubmitDiligence":{"type":"boolean"},"canRequestFinancing":{"type":"boolean"},"canEnrollLitigation":{"type":"boolean"},"canUseAuthorityShortcuts":{"type":"boolean"},"canManageWebhooks":{"type":"boolean"},"notificationMode":{"type":"string","enum":["none","email_only","webhook_only","email_and_webhook"]},"diligenceMode":{"type":"string","enum":["manual_only","provider_blocked","provider_ready"]},"counterpartyDiligenceMode":{"type":"string","enum":["manual_only","provider_blocked","provider_ready"]},"updatedAt":{"type":"string","format":"date-time"}}},"PartnerBrandingTheme":{"type":"object","required":["primaryColor","accentColor","backgroundColor","textColor"],"properties":{"primaryColor":{"type":["string","null"]},"accentColor":{"type":["string","null"]},"backgroundColor":{"type":["string","null"]},"textColor":{"type":["string","null"]}}},"PartnerBranding":{"type":"object","required":["partnerOrgId","brandDisplayName","logoUrl","replyToEmail","ctaLabel","theme","attributionMode","defaultDeliveryMode","senderDomain","senderDomainStatus","configuredCapabilities","activeCapabilities","updatedAt","reviewedAt"],"properties":{"partnerOrgId":{"type":"string","format":"uuid"},"brandDisplayName":{"type":["string","null"]},"logoUrl":{"type":["string","null"],"format":"uri"},"replyToEmail":{"type":["string","null"],"format":"email"},"ctaLabel":{"type":["string","null"]},"theme":{"$ref":"#/components/schemas/PartnerBrandingTheme"},"attributionMode":{"type":"string","enum":["dutyclaims_managed","partner_attributed"]},"defaultDeliveryMode":{"type":"string","enum":["dutyclaims_managed_email","partner_reply_to","custom_sender_domain"]},"senderDomain":{"type":["string","null"]},"senderDomainStatus":{"type":"string","enum":["not_requested","requested","approved","rejected"]},"configuredCapabilities":{"type":"array","items":{"type":"string","enum":["partner_display_name","partner_logo","partner_reply_to","partner_attributed_content","custom_sender_domain"]}},"activeCapabilities":{"type":"array","items":{"type":"string","enum":["partner_display_name","partner_logo","partner_reply_to","partner_attributed_content","custom_sender_domain"]}},"updatedAt":{"type":"string","format":"date-time"},"reviewedAt":{"type":["string","null"],"format":"date-time"}}},"RevenueStatusTotals":{"type":"object","required":["count","grossAmount","partnerShareAmount"],"properties":{"count":{"type":"integer","minimum":0},"grossAmount":{"type":"number"},"partnerShareAmount":{"type":"number"}}},"RevenueLedgerEntry":{"type":"object","required":["id","partnerOrgId","environment","eventType","category","status","grossAmount","dutyClaimsFeeAmount","partnerShareAmount","claimId","caseId","commissionId","payoutId","clientId","partnerClientId","partnerClaimReference","importerId","importerName","claimStatus","eventAt","earnedAt","payableAt","paidAt","metadata"],"properties":{"id":{"type":"string"},"partnerOrgId":{"type":"string","format":"uuid"},"environment":{"type":"string","enum":["sandbox","production"]},"eventType":{"type":"string","enum":["commission","payout"]},"category":{"type":"string","enum":["claims","financing","litigation"]},"status":{"type":"string","enum":["pending","earned","payable","paid","voided"]},"grossAmount":{"type":["number","null"]},"dutyClaimsFeeAmount":{"type":["number","null"]},"partnerShareAmount":{"type":["number","null"]},"claimId":{"type":["string","null"],"format":"uuid"},"caseId":{"type":["string","null"],"format":"uuid"},"commissionId":{"type":["string","null"],"format":"uuid"},"payoutId":{"type":["string","null"],"format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientId":{"type":["string","null"]},"partnerClaimReference":{"type":["string","null"]},"importerId":{"type":["string","null"],"format":"uuid"},"importerName":{"type":["string","null"]},"claimStatus":{"type":["string","null"]},"eventAt":{"type":"string","format":"date-time"},"earnedAt":{"type":["string","null"],"format":"date-time"},"payableAt":{"type":["string","null"],"format":"date-time"},"paidAt":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"RevenueDashboardSummary":{"type":"object","required":["partnerOrgId","environment","available","unavailableReason","generatedAt","totals","categoryTotals","latestEventAt"],"properties":{"partnerOrgId":{"type":"string","format":"uuid"},"environment":{"type":"string","enum":["sandbox","production"]},"available":{"type":"boolean"},"unavailableReason":{"type":["string","null"]},"generatedAt":{"type":"string","format":"date-time"},"totals":{"type":"object","required":["pending","earned","payable","paid","voided"],"properties":{"pending":{"$ref":"#/components/schemas/RevenueStatusTotals"},"earned":{"$ref":"#/components/schemas/RevenueStatusTotals"},"payable":{"$ref":"#/components/schemas/RevenueStatusTotals"},"paid":{"$ref":"#/components/schemas/RevenueStatusTotals"},"voided":{"$ref":"#/components/schemas/RevenueStatusTotals"}}},"categoryTotals":{"type":"object","required":["claims","financing","litigation"],"properties":{"claims":{"$ref":"#/components/schemas/RevenueStatusTotals"},"financing":{"$ref":"#/components/schemas/RevenueStatusTotals"},"litigation":{"$ref":"#/components/schemas/RevenueStatusTotals"}}},"latestEventAt":{"type":["string","null"],"format":"date-time"}}},"PartnerDashboardSummary":{"type":"object","required":["partnerOrgId","environment","generatedAt","filters","clients","claims","financedValueUsd","litigationExposureUsd","revenue","notes"],"properties":{"partnerOrgId":{"type":"string","format":"uuid"},"environment":{"type":"string","enum":["sandbox","production"]},"generatedAt":{"type":"string","format":"date-time"},"filters":{"type":"object","properties":{"dateFrom":{"type":"string","format":"date-time"},"dateTo":{"type":"string","format":"date-time"},"environment":{"type":"string","enum":["sandbox","production"]},"clientId":{"type":"string","format":"uuid"},"category":{"type":"string","enum":["claims","financing","litigation"]}},"additionalProperties":false},"clients":{"type":"object","required":["total","activated","invited","delegated"],"properties":{"total":{"type":"integer","minimum":0},"activated":{"type":"integer","minimum":0},"invited":{"type":"integer","minimum":0},"delegated":{"type":"integer","minimum":0}}},"claims":{"type":"object","required":["total","open","litigated"],"properties":{"total":{"type":"integer","minimum":0},"open":{"type":"integer","minimum":0},"litigated":{"type":"integer","minimum":0}}},"financedValueUsd":{"type":["number","null"]},"litigationExposureUsd":{"type":["number","null"]},"revenue":{"oneOf":[{"$ref":"#/components/schemas/RevenueDashboardSummary"},{"type":"null"}]},"notes":{"type":"array","items":{"type":"string"}}}},"PartnerNotificationRequest":{"type":"object","required":["id","partnerOrgId","clientId","claimId","caseId","type","channel","deliveryMode","deliveryState","source","emailCategory","recipientEmail","outboxId","logId","requestedAt","sentAt","deliveredAt","openedAt","clickedAt","convertedAt","metadata"],"properties":{"id":{"type":"string"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"claimId":{"type":["string","null"],"format":"uuid"},"caseId":{"type":["string","null"],"format":"uuid"},"type":{"type":["string","null"],"enum":["refund_opportunity","advance_offer","litigation_update","advance_disbursed","refund_received",null]},"channel":{"type":"string","enum":["email"]},"deliveryMode":{"type":"string","enum":["dutyclaims_managed_email","partner_reply_to","custom_sender_domain"]},"deliveryState":{"type":"string","enum":["queued","sent","failed","skipped","paused","in_app_only"]},"source":{"type":"string","enum":["partner_requested","workflow"]},"emailCategory":{"type":["string","null"]},"recipientEmail":{"type":["string","null"],"format":"email"},"outboxId":{"type":["string","null"],"format":"uuid"},"logId":{"type":["string","null"],"format":"uuid"},"requestedAt":{"type":"string","format":"date-time"},"sentAt":{"type":["string","null"],"format":"date-time"},"deliveredAt":{"type":["string","null"],"format":"date-time"},"openedAt":{"type":["string","null"],"format":"date-time"},"clickedAt":{"type":["string","null"],"format":"date-time"},"convertedAt":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"NotificationAnalyticsBucket":{"type":"object","required":["type","requested","sent","delivered","opened","clicked","failed"],"properties":{"type":{"type":"string","enum":["refund_opportunity","advance_offer","litigation_update","advance_disbursed","refund_received"]},"requested":{"type":"integer","minimum":0},"sent":{"type":"integer","minimum":0},"delivered":{"type":"integer","minimum":0},"opened":{"type":"integer","minimum":0},"clicked":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0}}},"NotificationAnalyticsResponse":{"type":"object","required":["generatedAt","partnerOrgId","totals","byType","attributionNotes"],"properties":{"generatedAt":{"type":"string","format":"date-time"},"partnerOrgId":{"type":"string","format":"uuid"},"totals":{"type":"object","required":["requested","sent","delivered","opened","clicked","failed","skipped","paused","inAppOnly","conversionAttributed"],"properties":{"requested":{"type":"integer","minimum":0},"sent":{"type":"integer","minimum":0},"delivered":{"type":"integer","minimum":0},"opened":{"type":"integer","minimum":0},"clicked":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"paused":{"type":"integer","minimum":0},"inAppOnly":{"type":"integer","minimum":0},"conversionAttributed":{"type":"integer","minimum":0}}},"byType":{"type":"array","items":{"$ref":"#/components/schemas/NotificationAnalyticsBucket"}},"attributionNotes":{"type":"array","items":{"type":"string"}}}},"PartnerCredential":{"type":"object","required":["id","partnerOrgId","label","keyPrefix","environment","status","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"label":{"type":"string"},"keyPrefix":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]},"status":{"type":"string","enum":["active","revoked"]},"legacyBrokerApiKeyId":{"type":["string","null"],"format":"uuid"},"createdByUserId":{"type":["string","null"]},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"PartnerWebhookEndpoint":{"type":"object","required":["id","partnerOrgId","label","url","subscribedEvents","environmentScope","status","secretPrefix","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"label":{"type":"string"},"url":{"type":"string","format":"uri"},"subscribedEvents":{"type":"array","items":{"type":"string"}},"environmentScope":{"type":"string","enum":["sandbox","production","all"]},"status":{"type":"string","enum":["active","disabled","revoked"]},"secretPrefix":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lastDeliveryAt":{"type":["string","null"],"format":"date-time"},"lastSuccessAt":{"type":["string","null"],"format":"date-time"},"lastFailureAt":{"type":["string","null"],"format":"date-time"}}},"PartnerWebhookDelivery":{"type":"object","required":["id","partnerOrgId","endpointId","eventId","eventType","endpointUrl","environment","status","attemptCount","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"endpointId":{"type":"string","format":"uuid"},"eventId":{"type":"string"},"eventType":{"type":"string"},"endpointUrl":{"type":"string","format":"uri"},"environment":{"type":"string","enum":["sandbox","production"]},"status":{"type":"string","enum":["queued","delivered","retrying","failed"]},"attemptCount":{"type":"integer"},"lastResponseStatus":{"type":["integer","null"]},"lastError":{"type":["string","null"]},"lastAttemptAt":{"type":["string","null"],"format":"date-time"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"deliveredAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"SandboxWebhookSignedPreview":{"type":"object","required":["event","timestamp","signature"],"properties":{"event":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"signature":{"type":"string"}}},"SandboxWebhookPayloadPreview":{"type":"object","required":["eventId","eventType","environment","occurredAt","payload"],"properties":{"eventId":{"type":"string","format":"uuid"},"eventType":{"type":"string","enum":["partner.test","partner.capability.changed","partner.environment.promoted","partner.credential.rotated"]},"environment":{"type":"string","enum":["sandbox","production"]},"occurredAt":{"type":"string","format":"date-time"},"payload":{"type":"object","additionalProperties":true}}},"SandboxWebhookTestResponse":{"type":"object","required":["requestId","eventId","eventType","environment","deliveryIds","endpointIds","signedPreview","payloadPreview"],"properties":{"requestId":{"type":"string"},"eventId":{"type":"string","format":"uuid"},"eventType":{"type":"string","enum":["partner.test","partner.capability.changed","partner.environment.promoted","partner.credential.rotated"]},"environment":{"type":"string","enum":["sandbox","production"]},"deliveryIds":{"type":"array","items":{"type":"string"}},"endpointIds":{"type":"array","items":{"type":"string","format":"uuid"}},"signedPreview":{"$ref":"#/components/schemas/SandboxWebhookSignedPreview"},"payloadPreview":{"$ref":"#/components/schemas/SandboxWebhookPayloadPreview"}}},"PartnerClient":{"type":"object","required":["id","partnerClientLinkId","partnerOrgId","accountStatus","status","relationshipOrigin","environmentState","delegationState","createdAt","updatedAt","identity"],"properties":{"id":{"type":"string","format":"uuid"},"partnerClientLinkId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"importerId":{"type":["string","null"],"format":"uuid"},"partnerClientId":{"type":["string","null"]},"label":{"type":["string","null"]},"accountStatus":{"type":"string","enum":["prospect","linked","archived"]},"status":{"type":"string","enum":["draft","invited","activated","inactive"]},"relationshipOrigin":{"type":"string","enum":["broker_invite","referral_link","admin_link","saas_activation","api_created"]},"environmentState":{"type":"string","enum":["sandbox","production"]},"delegationState":{"type":"string","enum":["not_delegated","delegated","revoked"]},"activatedAt":{"type":["string","null"],"format":"date-time"},"linkedImporterAt":{"type":["string","null"],"format":"date-time"},"delegationGrantedAt":{"type":["string","null"],"format":"date-time"},"delegationRevokedAt":{"type":["string","null"],"format":"date-time"},"litigationConsentedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"identity":{"type":"object","required":["legalName","ein","contactName","email","phone","address"],"properties":{"legalName":{"type":["string","null"]},"ein":{"type":["string","null"]},"contactName":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]},"address":{"type":["object","null"],"properties":{"state":{"type":["string","null"]},"addressLine1":{"type":["string","null"]},"addressLine2":{"type":["string","null"]},"city":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"country":{"type":["string","null"]}}}}},"metadata":{"type":"object","additionalProperties":true}}},"PartnerClientInvite":{"type":"object","required":["id","partnerOrgId","email","token","status","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"brokerClientInviteId":{"type":["string","null"],"format":"uuid"},"email":{"type":"string","format":"email"},"companyName":{"type":["string","null"]},"contactName":{"type":["string","null"]},"token":{"type":"string"},"status":{"type":"string","enum":["pending","accepted","expired","revoked"]},"acceptedImporterId":{"type":["string","null"],"format":"uuid"},"acceptedPartnerClientLinkId":{"type":["string","null"],"format":"uuid"},"acceptedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"PartnerAuthorityEvent":{"type":"object","required":["id","eventType","source","effectiveAt","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"eventType":{"type":"string","enum":["relationship_created","invite_created","invite_accepted","delegation_granted","delegation_revoked","poa_asserted","poa_accepted","poa_rejected","litigation_consent_recorded"]},"source":{"type":"string"},"actorUserId":{"type":["string","null"]},"partnerCredentialId":{"type":["string","null"],"format":"uuid"},"effectiveAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"PoaAssertion":{"type":"object","required":["id","partnerOrgId","clientId","partnerClientLinkId","assertionSource","evidenceReference","requestedScopes","validationStatus","validationOutcome","submittedAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"partnerClientLinkId":{"type":"string","format":"uuid"},"partnerCredentialId":{"type":["string","null"],"format":"uuid"},"assertionSource":{"type":"string"},"evidenceReference":{"type":"string"},"requestedScopes":{"type":"array","items":{"type":"string","enum":["claim_read","documents_upload","offer_actions","filing_preparation"]}},"validationStatus":{"type":"string","enum":["pending_review","accepted","rejected","expired"]},"validationOutcome":{"type":"string"},"validationNotes":{"type":["string","null"]},"reviewedByUserId":{"type":["string","null"]},"submittedAt":{"type":"string","format":"date-time"},"reviewedAt":{"type":["string","null"],"format":"date-time"},"effectiveAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"PartnerAuthorityState":{"type":"object","required":["client","stateLevel","activated","delegated","poaDocumentedScopes","litigationConsented","blockedReasons","events","poaAssertions"],"properties":{"client":{"$ref":"#/components/schemas/PartnerClient"},"stateLevel":{"type":"string","enum":["invited","activated","delegated","poa_documented","litigation_consented"]},"activated":{"type":"boolean"},"delegated":{"type":"boolean"},"poaDocumentedScopes":{"type":"array","items":{"type":"string","enum":["claim_read","documents_upload","offer_actions","filing_preparation"]}},"litigationConsented":{"type":"boolean"},"blockedReasons":{"type":"array","items":{"type":"string"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/PartnerAuthorityEvent"}},"poaAssertions":{"type":"array","items":{"$ref":"#/components/schemas/PoaAssertion"}}}},"OAuthTokenResponse":{"type":"object","required":["access_token","token_type","expires_in","scope"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"}}},"EntryIngestBatch":{"type":"object","required":["id","partnerOrgId","adapter","status","requestFingerprint","totalEntries","acceptedEntries","rejectedEntries","dedupedEntries","metadata","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"adapter":{"type":"string","enum":["canonical_json","generic_csv","cargowise_csv","magaya_json"]},"status":{"type":"string","enum":["accepted","processing","completed","failed"]},"idempotencyKey":{"type":["string","null"]},"requestFingerprint":{"type":"string"},"sourceName":{"type":["string","null"]},"sourceReference":{"type":["string","null"]},"totalEntries":{"type":"integer"},"acceptedEntries":{"type":"integer"},"rejectedEntries":{"type":"integer"},"dedupedEntries":{"type":"integer"},"errorSummary":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}}},"EntryIngestResult":{"type":"object","required":["batchItemId","entryNumber","identityHash","resultStatus","errors"],"properties":{"batchItemId":{"type":"string","format":"uuid"},"recordId":{"type":["string","null"],"format":"uuid"},"entryNumber":{"type":"string"},"identityHash":{"type":"string"},"resultStatus":{"type":"string","enum":["accepted","updated","unchanged","rejected"]},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"partnerClientId":{"type":["string","null"]},"message":{"type":["string","null"]},"errors":{"type":"array","items":{"type":"string"}}}},"EntryStatus":{"type":"object","required":["recordId","partnerOrgId","entryNumber","entryDate","importer","countryOfOrigin","totalDutyPaid","lineCount","version","lastResultStatus","firstIngestedAt","lastSeenAt","lastMaterialChangeAt","sourceAdapter","metadata"],"properties":{"recordId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"partnerClientId":{"type":["string","null"]},"entryNumber":{"type":"string"},"entryDate":{"type":"string","format":"date-time"},"importDate":{"type":["string","null"],"format":"date-time"},"importer":{"type":"object","required":["legalName"],"properties":{"legalName":{"type":"string"},"ein":{"type":["string","null"]},"contactName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"state":{"type":["string","null"]}}},"countryOfOrigin":{"type":"string"},"portOfEntry":{"type":["string","null"]},"totalDutyPaid":{"type":"number"},"lineCount":{"type":"integer"},"version":{"type":"integer"},"lastResultStatus":{"type":"string","enum":["accepted","updated","unchanged","rejected"]},"firstIngestedAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"},"lastMaterialChangeAt":{"type":"string","format":"date-time"},"sourceAdapter":{"type":"string","enum":["canonical_json","generic_csv","cargowise_csv","magaya_json"]},"metadata":{"type":"object","additionalProperties":true}}},"PortfolioScanSummary":{"type":"object","required":["totalEntries","processedEntries","newEntries","changedEntries","unchangedEntries","skippedEntries","errorEntries","eligibleEntries","ineligibleEntries","needsReviewEntries","totalDutyPaid","byClient"],"properties":{"totalEntries":{"type":"integer"},"processedEntries":{"type":"integer"},"newEntries":{"type":"integer"},"changedEntries":{"type":"integer"},"unchangedEntries":{"type":"integer"},"skippedEntries":{"type":"integer"},"errorEntries":{"type":"integer"},"eligibleEntries":{"type":"integer"},"ineligibleEntries":{"type":"integer"},"needsReviewEntries":{"type":"integer"},"totalDutyPaid":{"type":"number"},"byClient":{"type":"array","items":{"type":"object","required":["clientId","partnerClientId","importerName","totalEntries","eligibleEntries","changedEntries","skippedEntries","totalDutyPaid"],"properties":{"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientId":{"type":["string","null"]},"importerName":{"type":["string","null"]},"totalEntries":{"type":"integer"},"eligibleEntries":{"type":"integer"},"changedEntries":{"type":"integer"},"skippedEntries":{"type":"integer"},"totalDutyPaid":{"type":"number"}}}}}},"PortfolioScan":{"type":"object","required":["id","partnerOrgId","scanType","status","currentStage","progressPct","totalCount","processedCount","newCount","changedCount","unchangedCount","skippedCount","errorCount","eligibleCount","ineligibleCount","needsReviewCount","rateLimitApplied","summary","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"batchId":{"type":["string","null"],"format":"uuid"},"baselineScanId":{"type":["string","null"],"format":"uuid"},"scanType":{"type":"string","enum":["full","delta","client"]},"status":{"type":"string","enum":["queued","running","partial","failed","completed"]},"currentStage":{"type":"string"},"progressPct":{"type":"integer"},"totalCount":{"type":"integer"},"processedCount":{"type":"integer"},"newCount":{"type":"integer"},"changedCount":{"type":"integer"},"unchangedCount":{"type":"integer"},"skippedCount":{"type":"integer"},"errorCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"ineligibleCount":{"type":"integer"},"needsReviewCount":{"type":"integer"},"errorSummary":{"type":["string","null"]},"rateLimitApplied":{"type":"object","additionalProperties":true},"summary":{"$ref":"#/components/schemas/PortfolioScanSummary"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"failedAt":{"type":["string","null"],"format":"date-time"}}},"PortfolioScanResult":{"type":"object","required":["id","scanId","entryNumber","totalDutyPaid","changeType","action","eligibilityStatus","errors","metadata","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"scanId":{"type":"string","format":"uuid"},"entryRecordId":{"type":["string","null"],"format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"partnerClientId":{"type":["string","null"]},"entryNumber":{"type":"string"},"importerLegalName":{"type":["string","null"]},"importerEin":{"type":["string","null"]},"countryOfOrigin":{"type":["string","null"]},"totalDutyPaid":{"type":"number"},"changeType":{"type":"string","enum":["new","changed","unchanged"]},"action":{"type":"string","enum":["process","skip","manual_review","error"]},"eligibilityStatus":{"type":"string","enum":["eligible","ineligible","needs_review"]},"estimatedRefundMin":{"type":["number","null"]},"estimatedRefundMax":{"type":["number","null"]},"reason":{"type":["string","null"]},"errors":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}},"PortfolioScanEvent":{"type":"object","required":["id","scanId","partnerOrgId","eventType","summary","metadata","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"scanId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"eventType":{"type":"string"},"summary":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}},"CounterpartyAddress":{"type":"object","properties":{"addressLine1":{"type":["string","null"]},"addressLine2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"country":{"type":["string","null"]}}},"CounterpartyProfile":{"type":"object","required":["id","partnerOrgId","legalName","entityType","taxIdType","registeredAddress","principalAddress","beneficialOwnerRequired","metadata","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"importerId":{"type":["string","null"],"format":"uuid"},"externalCounterpartyId":{"type":["string","null"]},"legalName":{"type":"string"},"entityType":{"type":"string","enum":["corporation","llc","partnership","sole_proprietorship","individual","government","non_profit","other"]},"taxId":{"type":["string","null"]},"taxIdType":{"type":"string","enum":["ein","tin","itin","foreign_tax_id","unknown"]},"registeredAddress":{"$ref":"#/components/schemas/CounterpartyAddress"},"principalAddress":{"$ref":"#/components/schemas/CounterpartyAddress"},"duns":{"type":["string","null"]},"claimExposureUsd":{"type":["number","null"]},"beneficialOwnerRequired":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyGateResult":{"type":"object","required":["id","caseId","gateType","status","provenance","details","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"gateType":{"type":"string","enum":["business_verification","lien_and_encumbrance","sanctions_screening","financial_risk"]},"status":{"type":"string","enum":["pass","flag","fail","pending"]},"provenance":{"type":"string","enum":["manual","official_feed","provider"]},"sourceLabel":{"type":["string","null"]},"providerKey":{"type":["string","null"]},"providerReference":{"type":["string","null"]},"summary":{"type":["string","null"]},"details":{"type":"object","additionalProperties":true},"reviewedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyDiligenceCase":{"type":"object","required":["id","partnerOrgId","counterpartyId","operatingMode","providerReadiness","decision","reasonCodes","reportVersion","metadata","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"clientId":{"type":["string","null"],"format":"uuid"},"partnerClientLinkId":{"type":["string","null"],"format":"uuid"},"operatingMode":{"type":"string","enum":["manual_only","hybrid","provider_configured","provider_automated"]},"providerReadiness":{"type":"string","enum":["manual_only","hybrid","provider_configured","provider_automated"]},"decision":{"type":"string","enum":["approved","review","rejected","pending"]},"reasonCodes":{"type":"array","items":{"type":"string"}},"assignedReviewerUserId":{"type":["string","null"]},"reportVersion":{"type":"integer"},"lastDecidedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyCaseSummary":{"type":"object","required":["caseId","counterpartyId","legalName","decision","operatingMode","providerReadiness","gateStatuses","blockedReasons","updatedAt"],"properties":{"caseId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"legalName":{"type":"string"},"decision":{"type":"string","enum":["approved","review","rejected","pending"]},"operatingMode":{"type":"string","enum":["manual_only","hybrid","provider_configured","provider_automated"]},"providerReadiness":{"type":"string","enum":["manual_only","hybrid","provider_configured","provider_automated"]},"gateStatuses":{"type":"array","items":{"type":"object","required":["gateType","status"],"properties":{"gateType":{"type":"string","enum":["business_verification","lien_and_encumbrance","sanctions_screening","financial_risk"]},"status":{"type":"string","enum":["pass","flag","fail","pending"]}}}},"blockedReasons":{"type":"array","items":{"type":"string"}},"latestPartnerSummary":{"type":["string","null"]},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyEvidence":{"type":"object","required":["id","caseId","counterpartyId","category","title","storageType","storageReference","submittedByActorType","metadata","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"category":{"type":"string"},"title":{"type":"string"},"storageType":{"type":"string","enum":["reference","external_url","blob"]},"storageReference":{"type":"string"},"submittedByActorType":{"type":"string","enum":["partner_api","oauth","broker_bridge","admin_user","system"]},"submittedByUserId":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}},"CounterpartyReviewDecision":{"type":"object","required":["id","caseId","decision","reasonCodes","decisionBasis","overrideRequired","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"decision":{"type":"string","enum":["approved","review","rejected","pending"]},"reasonCodes":{"type":"array","items":{"type":"string"}},"decisionBasis":{"type":"string"},"internalNotes":{"type":["string","null"]},"partnerSummary":{"type":["string","null"]},"reviewerUserId":{"type":["string","null"]},"overrideRequired":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}},"CounterpartyProviderRun":{"type":"object","required":["id","caseId","counterpartyId","partnerOrgId","providerKey","runType","status","requestedByActorType","requestSummary","responseSummary","normalizedResult","attemptCount","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"gateType":{"type":["string","null"],"enum":["business_verification","lien_and_encumbrance","sanctions_screening","financial_risk",null]},"providerKey":{"type":"string"},"runType":{"type":"string","enum":["middesk_business_verification","middesk_lien_search","middesk_screening","dnb_match","dnb_financial_risk","springstreet_ucc_fallback","middesk_monitor_enrollment","dnb_monitor_enrollment"]},"status":{"type":"string","enum":["queued","running","completed","failed","blocked"]},"providerReference":{"type":["string","null"]},"parentRunId":{"type":["string","null"],"format":"uuid"},"requestedByActorType":{"type":"string","enum":["partner_api","oauth","broker_bridge","admin_user","system"]},"requestedByUserId":{"type":["string","null"]},"requestSummary":{"type":"object","additionalProperties":true},"responseSummary":{"type":"object","additionalProperties":true},"normalizedResult":{"type":"object","additionalProperties":true},"lastError":{"type":["string","null"]},"attemptCount":{"type":"integer"},"latencyMs":{"type":["integer","null"]},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyMonitoringSubscription":{"type":"object","required":["id","caseId","counterpartyId","partnerOrgId","providerKey","status","details","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"providerKey":{"type":"string"},"status":{"type":"string","enum":["pending","active","degraded","inactive"]},"providerReference":{"type":["string","null"]},"responseProtocol":{"type":["string","null"]},"details":{"type":"object","additionalProperties":true},"lastError":{"type":["string","null"]},"enrolledAt":{"type":["string","null"],"format":"date-time"},"lastAlertAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyMonitorAlert":{"type":"object","required":["id","caseId","counterpartyId","partnerOrgId","providerKey","eventType","severity","status","summary","details","triggeredAt","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"monitoringSubscriptionId":{"type":["string","null"],"format":"uuid"},"providerKey":{"type":"string"},"externalAlertId":{"type":["string","null"]},"eventType":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high","critical"]},"status":{"type":"string","enum":["open","acknowledged","resolved","dismissed"]},"responseProtocol":{"type":["string","null"]},"summary":{"type":"string"},"details":{"type":"object","additionalProperties":true},"sourceReference":{"type":["string","null"]},"monitorReference":{"type":["string","null"]},"triggeredAt":{"type":"string","format":"date-time"},"acknowledgedAt":{"type":["string","null"],"format":"date-time"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CounterpartyEvent":{"type":"object","required":["id","caseId","counterpartyId","partnerOrgId","eventType","actorType","summary","metadata","createdAt"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"counterpartyId":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"eventType":{"type":"string"},"actorType":{"type":"string"},"actorUserId":{"type":["string","null"]},"summary":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"}}},"CounterpartyDiligenceDetail":{"type":"object","required":["profile","beneficialOwners","case","summary","gates","evidence","events"],"properties":{"profile":{"$ref":"#/components/schemas/CounterpartyProfile"},"beneficialOwners":{"type":"array","items":{"type":"object","required":["id","fullName","isControlPerson","address","metadata","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"fullName":{"type":"string"},"title":{"type":["string","null"]},"ownershipPct":{"type":["number","null"]},"isControlPerson":{"type":"boolean"},"address":{"$ref":"#/components/schemas/CounterpartyAddress"},"taxIdLast4":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"case":{"$ref":"#/components/schemas/CounterpartyDiligenceCase"},"summary":{"$ref":"#/components/schemas/CounterpartyCaseSummary"},"gates":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyGateResult"}},"providerRuns":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyProviderRun"}},"monitoring":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyMonitoringSubscription"}},"monitorAlerts":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyMonitorAlert"}},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyEvidence"}},"latestDecision":{"oneOf":[{"$ref":"#/components/schemas/CounterpartyReviewDecision"},{"type":"null"}]},"events":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyEvent"}}}},"CounterpartyDiligenceReport":{"type":"object","allOf":[{"$ref":"#/components/schemas/CounterpartyDiligenceDetail"}],"properties":{"reportGeneratedAt":{"type":"string","format":"date-time"}},"required":["reportGeneratedAt"]},"LitigationReadiness":{"type":"object","required":["allowed","partnerSafeStatus","blockedReasons","litigationConsentPresent","delegatedAuthorityPresent","poaLitigationScopePresent"],"properties":{"allowed":{"type":"boolean"},"partnerSafeStatus":{"type":"string","enum":["ready","review_required","blocked"]},"blockedReasons":{"type":"array","items":{"type":"string"}},"authorityBasis":{"type":["string","null"],"enum":["litigation_consented","representation_active","representation_and_consent","policy_override",null]},"litigationConsentPresent":{"type":"boolean"},"delegatedAuthorityPresent":{"type":"boolean"},"poaLitigationScopePresent":{"type":"boolean"},"representation":{"type":["object","null"],"properties":{"activeRepresentationId":{"type":["string","null"],"format":"uuid"},"firmId":{"type":["string","null"],"format":"uuid"},"firmName":{"type":["string","null"]},"primaryAttorneyProfileId":{"type":["string","null"],"format":"uuid"},"primaryAttorneyName":{"type":["string","null"]},"status":{"type":["string","null"]},"scope":{"type":["string","null"]},"authorityStatus":{"type":["string","null"]},"authorityMissingItems":{"type":"array","items":{"type":"string"}},"conflictStatus":{"type":["string","null"]},"activatedAt":{"type":["string","null"],"format":"date-time"},"effectiveAt":{"type":["string","null"],"format":"date-time"}}},"counterpartyStatus":{"type":["object","null"],"properties":{"caseId":{"type":["string","null"],"format":"uuid"},"decision":{"type":["string","null"]},"partnerSafeStatus":{"type":["string","null"]},"blockedReasons":{"type":"array","items":{"type":"string"}}}}}},"LitigationPackageDelivery":{"type":"object","required":["id","snapshotId","claimId","recipientEmail","status","createdAt","updatedAt","metadata"],"properties":{"id":{"type":"string","format":"uuid"},"snapshotId":{"type":"string","format":"uuid"},"claimId":{"type":"string","format":"uuid"},"recipientEmail":{"type":"string","format":"email"},"recipientName":{"type":["string","null"]},"secureNote":{"type":["string","null"]},"status":{"type":"string","enum":["sent","failed","skipped"]},"errorMessage":{"type":["string","null"]},"sentAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"LitigationPackageSummary":{"type":"object","required":["claimId","readinessMissingItems","readinessWarnings","deliveryBlockers","contentCounts","deliveryState","deliveredRecipientCount","download","deliveries"],"properties":{"claimId":{"type":"string","format":"uuid"},"snapshotId":{"type":["string","null"],"format":"uuid"},"snapshotSequence":{"type":["integer","null"]},"packageVersion":{"type":["integer","null"]},"readinessLevel":{"type":["string","null"],"enum":["ready","ready_with_gaps","summary_only",null]},"readinessMissingItems":{"type":"array","items":{"type":"string"}},"readinessWarnings":{"type":"array","items":{"type":"string"}},"deliveryBlockers":{"type":"array","items":{"type":"string"}},"contentCounts":{"type":"object","required":["documents","deadlines","refundRows","entryWarnings","documentsByType"],"properties":{"documents":{"type":"integer"},"deadlines":{"type":"integer"},"refundRows":{"type":"integer"},"entryWarnings":{"type":"integer"},"documentsByType":{"type":"object","additionalProperties":{"type":"integer"}}}},"deliveryState":{"type":"string","enum":["not_generated","generated","delivered","partial","failed"]},"deliveredRecipientCount":{"type":"integer"},"latestDeliveryAt":{"type":["string","null"],"format":"date-time"},"generatedAt":{"type":["string","null"],"format":"date-time"},"download":{"type":"object","required":["url","expiresAt"],"properties":{"url":{"type":["string","null"],"format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"}}},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/LitigationPackageDelivery"}}}},"LitigationEvent":{"type":"object","required":["id","caseId","eventType","source","title","summary","occurredAt","metadata"],"properties":{"id":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"eventType":{"type":"string","enum":["enrollment_requested","status_updated","docket_updated","package_ready","package_delivery_requested","package_delivery_succeeded","package_delivery_failed"]},"source":{"type":"string","enum":["partner_api","operator_manual","provider_feed","system"]},"title":{"type":"string"},"summary":{"type":"string"},"statusAfter":{"type":["string","null"]},"nextKeyDate":{"type":["string","null"],"format":"date-time"},"occurredAt":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"LitigationCase":{"type":"object","required":["id","partnerOrgId","clientId","partnerClientLinkId","claimId","requestedTrack","status","combinedPathMode","requestedAt","createdAt","updatedAt","claim","readiness","packageSummary","combinedPath","recentEvents"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"partnerClientLinkId":{"type":"string","format":"uuid"},"claimId":{"type":"string","format":"uuid"},"importerId":{"type":["string","null"],"format":"uuid"},"counterpartyCaseId":{"type":["string","null"],"format":"uuid"},"requestedTrack":{"type":"string","enum":["protest_only","cit_only","protest_and_cit"]},"status":{"type":"string","enum":["requested","blocked","ready_for_package","package_ready","delivered","active","closed"]},"authorityBasis":{"type":["string","null"]},"combinedPathMode":{"type":"string","enum":["litigation_only","combined"]},"offerId":{"type":["string","null"],"format":"uuid"},"advanceId":{"type":["string","null"],"format":"uuid"},"partnerCaseReference":{"type":["string","null"]},"partnerNotes":{"type":["string","null"]},"litigationPortionNote":{"type":["string","null"]},"requestedAt":{"type":"string","format":"date-time"},"nextKeyDate":{"type":["string","null"],"format":"date-time"},"latestEventAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"claim":{"type":"object","required":["claimId","claimStatus","currentStage"],"properties":{"claimId":{"type":"string","format":"uuid"},"partnerClaimReference":{"type":["string","null"]},"claimStatus":{"type":"string"},"currentStage":{"type":"string"},"importerId":{"type":["string","null"],"format":"uuid"},"importerName":{"type":["string","null"]},"estimatedValue":{"type":["number","null"]},"actualValue":{"type":["number","null"]},"refundAmount":{"type":["number","null"]}}},"readiness":{"$ref":"#/components/schemas/LitigationReadiness"},"packageSummary":{"$ref":"#/components/schemas/LitigationPackageSummary"},"combinedPath":{"type":"object","required":["mode","offerId","offerStatus","advanceId","advanceStatus","litigationPortionNote"],"properties":{"mode":{"type":"string","enum":["litigation_only","combined"]},"offerId":{"type":["string","null"],"format":"uuid"},"offerStatus":{"type":["string","null"]},"advanceId":{"type":["string","null"],"format":"uuid"},"advanceStatus":{"type":["string","null"]},"litigationPortionNote":{"type":["string","null"]}}},"recentEvents":{"type":"array","items":{"$ref":"#/components/schemas/LitigationEvent"}}}},"ClaimScoreWarning":{"type":"object","required":["code","level","message"],"properties":{"code":{"type":"string"},"level":{"type":"string","enum":["validation_error","warning","manual_review"]},"message":{"type":"string"}}},"ClaimDeadlineEntry":{"type":"object","required":["entryNumber","estimatedLiqDate","pscDeadline","protestDeadline","daysUntilPsc","daysUntilProtest","urgency","nextAction"],"properties":{"entryNumber":{"type":"string"},"estimatedLiqDate":{"type":"string","format":"date-time"},"pscDeadline":{"type":["string","null"],"format":"date-time"},"protestDeadline":{"type":["string","null"],"format":"date-time"},"daysUntilPsc":{"type":["integer","null"]},"daysUntilProtest":{"type":["integer","null"]},"urgency":{"type":"string","enum":["safe","watch","warning","critical","expired"]},"nextAction":{"type":"string"}}},"ClaimDocumentSummary":{"type":"object","required":["totalDocuments","pendingReviewCount","flaggedCount","checklist"],"properties":{"totalDocuments":{"type":"integer"},"pendingReviewCount":{"type":"integer"},"flaggedCount":{"type":"integer"},"checklist":{"type":"array","items":{"type":"object","required":["type","label","state","required","documentCount","flaggedCount"],"properties":{"type":{"type":"string","enum":["form_7501","invoice","agreement","correspondence"]},"label":{"type":"string"},"state":{"type":"string","enum":["missing","uploaded","review_flagged","accepted"]},"required":{"type":"boolean"},"documentCount":{"type":"integer"},"flaggedCount":{"type":"integer"}}}}}},"ClaimDeadlineSummary":{"type":"object","required":["earliestDeadline","urgentEntryCount","expiredEntryCount","nextAction","entries"],"properties":{"earliestDeadline":{"type":["string","null"],"format":"date-time"},"urgentEntryCount":{"type":"integer"},"expiredEntryCount":{"type":"integer"},"nextAction":{"type":["string","null"]},"entries":{"type":"array","items":{"$ref":"#/components/schemas/ClaimDeadlineEntry"}}}},"ClaimAggregateSummary":{"type":"object","required":["entryCount","eligibleEntryCount","ineligibleEntryCount","reviewEntryCount","warningCount","estimatedRefundAmount","estimatedInterestAmount","totalPotentialValue"],"properties":{"entryCount":{"type":"integer"},"eligibleEntryCount":{"type":"integer"},"ineligibleEntryCount":{"type":"integer"},"reviewEntryCount":{"type":"integer"},"warningCount":{"type":"integer"},"estimatedRefundAmount":{"type":"number"},"estimatedInterestAmount":{"type":"number"},"totalPotentialValue":{"type":"number"}}},"ClaimDiligenceSummary":{"type":"object","required":["caseId","status","providerReadiness","reasonCodes","updatedAt"],"properties":{"caseId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["approved","review","rejected","pending"]},"providerReadiness":{"type":"string","enum":["manual_only","hybrid","provider_configured","provider_automated"]},"reasonCodes":{"type":"array","items":{"type":"string"}},"updatedAt":{"type":"string","format":"date-time"}}},"Claim":{"type":"object","required":["id","partnerOrgId","clientId","partnerClientLinkId","status","currentStage","htsCodes","createdAt","updatedAt","client","importer","scoreSummary","deadlines","documentSummary","diligenceSummary"],"properties":{"id":{"type":"string","format":"uuid"},"partnerOrgId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"partnerClientLinkId":{"type":"string","format":"uuid"},"partnerClientId":{"type":["string","null"]},"importerId":{"type":["string","null"],"format":"uuid"},"partnerClaimReference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","submitted","in_review","protested","refund_pending","closed"]},"currentStage":{"type":"string","enum":["lead","qualified","agreement_signed","documents_collected","protest_filed","cbp_ruling_pending","refund_approved","closed"]},"estimatedValue":{"type":["number","null"]},"actualValue":{"type":["number","null"]},"refundAmount":{"type":["number","null"]},"htsCodes":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"client":{"type":"object","required":["id","partnerClientLinkId","partnerClientId","legalName","email","importerId"],"properties":{"id":{"type":"string","format":"uuid"},"partnerClientLinkId":{"type":"string","format":"uuid"},"partnerClientId":{"type":["string","null"]},"legalName":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"importerId":{"type":["string","null"],"format":"uuid"}}},"importer":{"oneOf":[{"type":"object","required":["id","legalName","ein","contactName","email","phone","state"],"properties":{"id":{"type":"string","format":"uuid"},"legalName":{"type":"string"},"ein":{"type":"string"},"contactName":{"type":["string","null"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"]},"state":{"type":["string","null"]}}},{"type":"null"}]},"scoreSummary":{"$ref":"#/components/schemas/ClaimAggregateSummary"},"deadlines":{"$ref":"#/components/schemas/ClaimDeadlineSummary"},"documentSummary":{"$ref":"#/components/schemas/ClaimDocumentSummary"},"diligenceSummary":{"oneOf":[{"$ref":"#/components/schemas/ClaimDiligenceSummary"},{"type":"null"}]}}},"ClaimTimelineEvent":{"type":"object","required":["id","type","label","occurredAt","stage","status","note","actorType"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["claim_created","stage_changed","agreement_signed","document_uploaded","claim_updated"]},"label":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"stage":{"type":["string","null"],"enum":["lead","qualified","agreement_signed","documents_collected","protest_filed","cbp_ruling_pending","refund_approved","closed",null]},"status":{"type":["string","null"],"enum":["draft","submitted","in_review","protested","refund_pending","closed",null]},"note":{"type":["string","null"]},"actorType":{"type":"string","enum":["system","partner","admin"]}}},"ClaimStatusResponse":{"type":"object","required":["claimId","status","currentStage","partnerClaimReference","deadlines","documentSummary","timeline"],"properties":{"claimId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","submitted","in_review","protested","refund_pending","closed"]},"currentStage":{"type":"string","enum":["lead","qualified","agreement_signed","documents_collected","protest_filed","cbp_ruling_pending","refund_approved","closed"]},"partnerClaimReference":{"type":["string","null"]},"deadlines":{"$ref":"#/components/schemas/ClaimDeadlineSummary"},"documentSummary":{"$ref":"#/components/schemas/ClaimDocumentSummary"},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/ClaimTimelineEvent"}}}},"ClaimDocument":{"type":"object","required":["id","documentId","claimId","type","partnerReference","originalFilename","contentType","sizeBytes","uploadState","reviewState","uploadedAt"],"properties":{"id":{"type":"string","format":"uuid"},"documentId":{"type":"string","format":"uuid"},"claimId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["form_7501","invoice","agreement","correspondence"]},"partnerReference":{"type":["string","null"]},"originalFilename":{"type":"string"},"contentType":{"type":["string","null"]},"sizeBytes":{"type":["integer","null"]},"uploadState":{"type":"string","enum":["uploaded","processing","failed"]},"reviewState":{"type":"string","enum":["not_required","pending_review","accepted","flagged"]},"uploadedAt":{"type":"string","format":"date-time"}}},"ClaimScoreResponse":{"type":"object","required":["results","summary"],"properties":{"results":{"type":"array","items":{"type":"object","required":["entryNumber","eligibility","refundPathway","estimatedRefundAmount","estimatedInterestAmount","totalPotentialValue","deadlines","warnings","documentReadiness"],"properties":{"entryNumber":{"type":"string"},"eligibility":{"type":"string","enum":["eligible","ineligible","needs_review"]},"refundPathway":{"type":"string","enum":["PSC","PROTEST","CIT","UNCLEAR"]},"estimatedRefundAmount":{"type":"number"},"estimatedInterestAmount":{"type":"number"},"totalPotentialValue":{"type":"number"},"deadlines":{"$ref":"#/components/schemas/ClaimDeadlineEntry"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/ClaimScoreWarning"}},"documentReadiness":{"type":"object","required":["requiredDocumentTypes","recommendedDocumentTypes","summary"],"properties":{"requiredDocumentTypes":{"type":"array","items":{"type":"string","enum":["form_7501","invoice","agreement","correspondence"]}},"recommendedDocumentTypes":{"type":"array","items":{"type":"string","enum":["form_7501","invoice","agreement","correspondence"]}},"summary":{"type":"string"}}}}}},"summary":{"type":"object","required":["entryCount","eligibleEntryCount","ineligibleEntryCount","reviewEntryCount","estimatedRefundAmount","estimatedInterestAmount","totalPotentialValue","warningCount"],"properties":{"entryCount":{"type":"integer"},"eligibleEntryCount":{"type":"integer"},"ineligibleEntryCount":{"type":"integer"},"reviewEntryCount":{"type":"integer"},"estimatedRefundAmount":{"type":"number"},"estimatedInterestAmount":{"type":"number"},"totalPotentialValue":{"type":"number"},"warningCount":{"type":"integer"}}}}}}},"paths":{"/v1/diligence/submit":{"post":{"summary":"Submit a diligence portfolio","security":[{"BearerApiKey":[]},{"XApiKey":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"seller_name":{"type":"string"},"requires_protest_documentation":{"type":"boolean"},"protest_requirement_reason":{"type":"string"},"file":{"type":"array","items":{"type":"string","format":"binary"}}},"required":["file"]}}}},"responses":{"202":{"description":"Bulk job created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiligenceSubmissionAccepted"}}}},"400":{"description":"Invalid submission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Submission or storage failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/diligence/jobs/{jobId}/resume":{"post":{"summary":"Resume a failed or partial bulk job","security":[{"BearerApiKey":[]},{"XApiKey":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Resume accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiligenceResumeAccepted"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Job is not resumable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Resume scheduling failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/diligence/status/{jobId}":{"get":{"summary":"Fetch diligence bulk-job status","security":[{"BearerApiKey":[]},{"XApiKey":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job status payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkJobStatus"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/diligence/report/{jobId}":{"get":{"summary":"Fetch diligence report JSON or PDF","description":"Returns the typed diligence report for one job. Partner integrations consume RF8 only through the read-only rf8Review field in this report; DutyClaims does not publish standalone RF8 verification or source-configuration endpoints.","security":[{"BearerApiKey":[]},{"XApiKey":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","pdf"]}}],"responses":{"200":{"description":"Diligence report payload or PDF, including read-only RF8 report state when available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiligenceReport"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Report not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/diligence/dataset/{jobId}":{"get":{"summary":"Fetch entry-level dataset JSON, CSV, or XLSX","security":[{"BearerApiKey":[]},{"XApiKey":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv","xlsx"]}}],"responses":{"200":{"description":"Dataset payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiligenceDatasetJson"}},"text/csv":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Dataset not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/partner-organizations/{partnerOrgId}":{"get":{"summary":"Fetch partner organization state","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"partnerOrgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Partner organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerOrganization"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/partner-organizations/{partnerOrgId}/capabilities":{"get":{"summary":"Fetch partner capabilities","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"partnerOrgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Partner capabilities","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerCapability"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/partner-organizations/{partnerOrgId}/branding":{"get":{"summary":"Fetch partner branding and white-label policy state","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"partnerOrgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Partner branding configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBranding"}}}}}},"put":{"summary":"Create or update partner branding and default delivery policy","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"partnerOrgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brandDisplayName":{"type":"string","nullable":true},"logoUrl":{"type":"string","format":"uri","nullable":true},"replyToEmail":{"type":"string","format":"email","nullable":true},"ctaLabel":{"type":"string","nullable":true},"theme":{"type":"object","properties":{"primaryColor":{"type":"string","nullable":true},"accentColor":{"type":"string","nullable":true},"backgroundColor":{"type":"string","nullable":true},"textColor":{"type":"string","nullable":true}}},"attributionMode":{"type":"string","enum":["dutyclaims_managed","partner_attributed"]},"defaultDeliveryMode":{"type":"string","enum":["dutyclaims_managed_email","partner_reply_to","custom_sender_domain"]},"senderDomain":{"type":"string","nullable":true},"senderDomainStatus":{"type":"string","enum":["not_requested","requested","approved","rejected"]}}}}}},"responses":{"200":{"description":"Updated partner branding configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerBranding"}}}}}}},"/v1/partner/dashboard":{"get":{"summary":"Fetch aggregate partner dashboard metrics and scoped revenue totals","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"environment","in":"query","schema":{"type":"string","enum":["sandbox","production"]}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"category","in":"query","schema":{"type":"string","enum":["claims","financing","litigation"]}}],"responses":{"200":{"description":"Partner dashboard summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerDashboardSummary"}}}}}}},"/v1/clients":{"get":{"summary":"List client accounts for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["draft","invited","activated","inactive"]}},{"name":"partnerClientId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Client list","content":{"application/json":{"schema":{"type":"object","required":["clients","page","limit","hasMore"],"properties":{"clients":{"type":"array","items":{"$ref":"#/components/schemas/PartnerClient"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}},"post":{"summary":"Create or link a canonical partner client","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"importerId":{"type":"string","format":"uuid"},"partnerClientId":{"type":"string"},"label":{"type":"string"},"relationshipOrigin":{"type":"string","enum":["broker_invite","referral_link","admin_link","saas_activation","api_created"]},"legalName":{"type":"string"},"ein":{"type":"string"},"contactName":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"state":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Client created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerClient"}}}}}}},"/v1/clients/{clientId}":{"get":{"summary":"Fetch a partner-scoped client","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerClient"}}}}}}},"/v1/clients/{clientId}/invites":{"post":{"summary":"Create a client invite for an existing partner client","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"companyName":{"type":"string"},"contactName":{"type":"string"},"expiresInDays":{"type":"integer"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Invite created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerClientInvite"}}}}}}},"/v1/client-invites/{token}/accept":{"post":{"summary":"Accept a client invite","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"importerId":{"type":"string","format":"uuid"},"legalName":{"type":"string"},"ein":{"type":"string"},"contactName":{"type":"string"},"phone":{"type":"string"},"state":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Invite accepted","content":{"application/json":{"schema":{"type":"object","required":["invite","client"],"properties":{"invite":{"$ref":"#/components/schemas/PartnerClientInvite"},"client":{"$ref":"#/components/schemas/PartnerClient"}}}}}}}}},"/v1/clients/{clientId}/authority":{"get":{"summary":"Fetch authority state and event timeline for a client relationship","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Authority state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerAuthorityState"}}}}}}},"/v1/clients/{clientId}/delegations":{"post":{"summary":"Grant delegation for a broker client relationship","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Updated authority state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerAuthorityState"}}}}}},"delete":{"summary":"Revoke delegation for a broker client relationship","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Updated authority state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerAuthorityState"}}}}}}},"/v1/clients/{clientId}/poa-assertions":{"get":{"summary":"List POA assertions for a client relationship","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"POA assertions","content":{"application/json":{"schema":{"type":"object","required":["assertions"],"properties":{"assertions":{"type":"array","items":{"$ref":"#/components/schemas/PoaAssertion"}}}}}}}}},"post":{"summary":"Submit a broker POA assertion","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"POA assertions after submission","content":{"application/json":{"schema":{"type":"object","required":["assertions"],"properties":{"assertions":{"type":"array","items":{"$ref":"#/components/schemas/PoaAssertion"}}}}}}}}}},"/v1/webhooks/endpoints":{"get":{"summary":"List webhook endpoints for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"responses":{"200":{"description":"Webhook endpoints","content":{"application/json":{"schema":{"type":"object","required":["endpoints"],"properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/PartnerWebhookEndpoint"}}}}}}}}},"post":{"summary":"Register a webhook endpoint","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label","url","subscribedEvents"],"properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"},"subscribedEvents":{"type":"array","items":{"type":"string"}},"environmentScope":{"type":"string","enum":["sandbox","production","all"]}}}}}},"responses":{"201":{"description":"Webhook endpoint created","content":{"application/json":{"schema":{"type":"object","required":["endpoint","signingSecret"],"properties":{"endpoint":{"$ref":"#/components/schemas/PartnerWebhookEndpoint"},"signingSecret":{"type":"string"}}}}}},"403":{"description":"Missing webhook capability","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/webhook-deliveries":{"get":{"summary":"List webhook deliveries for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"endpointId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string","enum":["queued","delivered","retrying","failed"]}}],"responses":{"200":{"description":"Webhook deliveries","content":{"application/json":{"schema":{"type":"object","required":["deliveries"],"properties":{"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/PartnerWebhookDelivery"}}}}}}}}}},"/v1/sandbox/webhooks/test":{"post":{"summary":"Trigger a synthetic sandbox webhook event","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpointId":{"type":"string","format":"uuid"},"eventType":{"type":"string","enum":["partner.test","partner.capability.changed","partner.environment.promoted","partner.credential.rotated"]},"environment":{"type":"string","enum":["sandbox","production"]},"payload":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Synthetic webhook dispatched","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxWebhookTestResponse"}}}},"404":{"description":"Requested endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"No active webhook endpoints available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/oauth/token":{"post":{"summary":"Issue a sandbox OAuth client-credentials token","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string"}}}}}},"responses":{"200":{"description":"OAuth access token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}}},"401":{"description":"Invalid client credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/entries/ingest":{"post":{"summary":"Ingest a single canonical entry","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entry"],"properties":{"clientId":{"type":"string","format":"uuid"},"partnerClientId":{"type":"string"},"source":{"type":"object","additionalProperties":true},"entry":{"type":"object","required":["entryNumber","entryDate","importer","countryOfOrigin","totalDutyPaid","htsLines"],"properties":{"entryNumber":{"type":"string"},"entryDate":{"type":"string"},"importDate":{"type":"string"},"partnerClientId":{"type":"string"},"countryOfOrigin":{"type":"string"},"portOfEntry":{"type":"string"},"totalDutyPaid":{"type":"number"},"importer":{"type":"object","required":["legalName"],"properties":{"legalName":{"type":"string"},"ein":{"type":"string"},"contactName":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"state":{"type":"string"}}},"htsLines":{"type":"array","items":{"type":"object","required":["htsCode","dutyPaid"],"properties":{"lineNumber":{"type":"integer"},"htsCode":{"type":"string"},"chapter99Code":{"type":"string"},"dutyPaid":{"type":"number"},"enteredValue":{"type":"number"}}}},"metadata":{"type":"object","additionalProperties":true}}}}}}}},"responses":{"201":{"description":"Entry ingested","content":{"application/json":{"schema":{"type":"object","required":["batch","results"],"properties":{"batch":{"$ref":"#/components/schemas/EntryIngestBatch"},"results":{"type":"array","items":{"$ref":"#/components/schemas/EntryIngestResult"}}}}}}}}}},"/v1/entries/batch":{"post":{"summary":"Ingest a partner entry batch through a named adapter","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid"},"partnerClientId":{"type":"string"},"adapter":{"type":"string","enum":["canonical_json","generic_csv","cargowise_csv","magaya_json"]},"source":{"type":"object","additionalProperties":true},"entries":{"type":"array","items":{"type":"object","additionalProperties":true}},"csv":{"type":"string"},"payload":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"array","items":{"type":"object","additionalProperties":true}}]},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"202":{"description":"Batch accepted","content":{"application/json":{"schema":{"type":"object","required":["batch","results"],"properties":{"batch":{"$ref":"#/components/schemas/EntryIngestBatch"},"results":{"type":"array","items":{"$ref":"#/components/schemas/EntryIngestResult"}}}}}}},"422":{"description":"Adapter validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/entries/{entryNumber}/status":{"get":{"summary":"Fetch entry ingest status for an entry number","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"entryNumber","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Entry ingest status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryStatus"}}}}}}},"/v1/portfolio-scans":{"post":{"summary":"Create a durable portfolio scan job","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scanType":{"type":"string","enum":["full","delta","client"]},"clientId":{"type":"string","format":"uuid"},"partnerClientId":{"type":"string"},"batchId":{"type":"string","format":"uuid"},"baselineScanId":{"type":"string","format":"uuid"},"includeUnchanged":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"202":{"description":"Scan queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioScan"}}}}}}},"/v1/portfolio-scans/{scanId}":{"get":{"summary":"Fetch a portfolio scan job with result slices","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"scanId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Portfolio scan detail","content":{"application/json":{"schema":{"type":"object","allOf":[{"$ref":"#/components/schemas/PortfolioScan"}],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioScanResult"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioScanEvent"}}},"required":["results","events"]}}}}}}},"/v1/portfolio-scans/{scanId}/delta":{"post":{"summary":"Create a delta scan based on a completed scan","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"scanId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Delta scan queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioScan"}}}}}}},"/v1/portfolio-scans/{scanId}/summary":{"get":{"summary":"Fetch the summary-only view for a portfolio scan","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"scanId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Portfolio scan summary","content":{"application/json":{"schema":{"type":"object","required":["scan","summary"],"properties":{"scan":{"$ref":"#/components/schemas/PortfolioScan"},"summary":{"$ref":"#/components/schemas/PortfolioScanSummary"}}}}}}}}},"/v1/claim-scores":{"post":{"summary":"Score normalized entries without creating a claim","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entries"],"properties":{"asOfDate":{"type":"string","format":"date-time"},"entries":{"type":"array","items":{"type":"object","required":["entryNumber","entryDate","importDate","countryOfOrigin","totalDutyPaid","liquidationStatus","htsLines"],"properties":{"entryNumber":{"type":"string"},"entryDate":{"type":"string"},"importDate":{"type":"string"},"countryOfOrigin":{"type":"string"},"totalDutyPaid":{"type":"number"},"liquidationStatus":{"type":"string","enum":["liquidated","unliquidated","suspended"]},"liquidationDate":{"type":"string"},"portCode":{"type":"string"},"declaredValue":{"type":"number"},"htsLines":{"type":"array","items":{"type":"object","required":["htsCode","dutyPaid"],"properties":{"lineNumber":{"type":"integer"},"htsCode":{"type":"string"},"description":{"type":"string"},"dutyPaid":{"type":"number"},"dutyRate":{"type":"number"},"enteredValue":{"type":"number"}}}}}}}}}}}},"responses":{"200":{"description":"Claim score response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimScoreResponse"}}}}}}},"/v1/claims":{"get":{"summary":"List partner-accessible claims","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"partnerClientId","in":"query","schema":{"type":"string"}},{"name":"partnerClaimReference","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["draft","submitted","in_review","protested","refund_pending","closed"]}},{"name":"createdFrom","in":"query","schema":{"type":"string"}},{"name":"createdTo","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Claim list","content":{"application/json":{"schema":{"type":"object","required":["items","page","limit","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}},"post":{"summary":"Create a partner claim linked to a client relationship","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entries"],"properties":{"clientId":{"type":"string","format":"uuid"},"partnerClientId":{"type":"string"},"partnerClaimReference":{"type":"string"},"importer":{"type":"object","properties":{"legalName":{"type":"string"},"ein":{"type":"string"},"contactName":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"state":{"type":"string"}}},"entries":{"type":"array","items":{"type":"object","additionalProperties":true}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Claim created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}},"409":{"description":"Duplicate request in progress or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/claims/{claimId}":{"get":{"summary":"Fetch a partner-safe claim read model","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Claim detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Claim"}}}}}}},"/v1/claims/{claimId}/status":{"get":{"summary":"Fetch current status and timeline for a claim","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Claim status detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimStatusResponse"}}}}}}},"/v1/claims/status":{"get":{"summary":"List claim statuses for partner dashboards","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"partnerClientId","in":"query","schema":{"type":"string"}},{"name":"partnerClaimReference","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["draft","submitted","in_review","protested","refund_pending","closed"]}}],"responses":{"200":{"description":"Claim status list","content":{"application/json":{"schema":{"type":"object","required":["items","page","limit","hasMore"],"properties":{"items":{"type":"array","items":{"type":"object","required":["claimId","clientId","partnerClientId","partnerClaimReference","status","currentStage","estimatedValue","earliestDeadline","pendingReviewCount","flaggedCount","createdAt"],"properties":{"claimId":{"type":"string","format":"uuid"},"clientId":{"type":"string","format":"uuid"},"partnerClientId":{"type":["string","null"]},"partnerClaimReference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","submitted","in_review","protested","refund_pending","closed"]},"currentStage":{"type":"string","enum":["lead","qualified","agreement_signed","documents_collected","protest_filed","cbp_ruling_pending","refund_approved","closed"]},"estimatedValue":{"type":["number","null"]},"earliestDeadline":{"type":["string","null"],"format":"date-time"},"pendingReviewCount":{"type":"integer"},"flaggedCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}},"/v1/claims/{claimId}/documents":{"get":{"summary":"List claim documents and partner review state","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Claim documents","content":{"application/json":{"schema":{"type":"object","required":["documents","documentSummary"],"properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/ClaimDocument"}},"documentSummary":{"$ref":"#/components/schemas/ClaimDocumentSummary"}}}}}}}},"post":{"summary":"Upload a claim document","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["type","file"],"properties":{"type":{"type":"string","enum":["form_7501","invoice","agreement","correspondence"]},"partnerReference":{"type":"string"},"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Document uploaded","content":{"application/json":{"schema":{"type":"object","required":["document","documentSummary"],"properties":{"document":{"$ref":"#/components/schemas/ClaimDocument"},"documentSummary":{"$ref":"#/components/schemas/ClaimDocumentSummary"}}}}}}}}},"/v1/documents/{documentId}/download":{"get":{"summary":"Issue or redeem a signed claim document download URL","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"t","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Signed download payload or file stream","content":{"application/json":{"schema":{"type":"object","required":["documentId","expiresAt","downloadUrl"],"properties":{"documentId":{"type":"string","format":"uuid"},"expiresAt":{"type":"string","format":"date-time"},"downloadUrl":{"type":"string","format":"uri"}}}}}}}}},"/v1/reference/hts/search":{"get":{"summary":"Search the synced official HTS release with DutyClaims overlay context","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"code","in":"query","schema":{"type":"string"}},{"name":"target_date","in":"query","schema":{"type":"string"}},{"name":"country","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"HTS search response","content":{"application/json":{"schema":{"type":"object","required":["meta"],"properties":{"meta":{"type":"object","required":["activeReleaseLabel","activeReleasePublishedAt","isStale","staleReason"],"properties":{"activeReleaseLabel":{"type":["string","null"]},"activeReleasePublishedAt":{"type":["string","null"]},"isStale":{"type":"boolean"},"staleReason":{"type":["string","null"]}}},"result":{"type":"object","additionalProperties":true},"results":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}},"/v1/reference/countries":{"get":{"summary":"List supported reference countries","responses":{"200":{"description":"Reference countries","content":{"application/json":{"schema":{"type":"object","required":["countries"],"properties":{"countries":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"}}}}}}}}}}}},"/v1/health/public":{"get":{"summary":"Return public API health and capability metadata","responses":{"200":{"description":"Public health","content":{"application/json":{"schema":{"type":"object","required":["status","service","apiVersion","timestamp","capabilities"],"properties":{"status":{"type":"string"},"service":{"type":"string"},"apiVersion":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"capabilities":{"type":"object","additionalProperties":true}}}}}}}}},"/v1/revenue/dashboard":{"get":{"summary":"Fetch canonical partner revenue dashboard totals","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"environment","in":"query","schema":{"type":"string","enum":["sandbox","production"]}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"category","in":"query","schema":{"type":"string","enum":["claims","financing","litigation"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","earned","payable","paid","voided"]}}],"responses":{"200":{"description":"Revenue dashboard summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueDashboardSummary"}}}}}}},"/v1/revenue/ledger":{"get":{"summary":"List canonical revenue ledger entries for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"environment","in":"query","schema":{"type":"string","enum":["sandbox","production"]}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"category","in":"query","schema":{"type":"string","enum":["claims","financing","litigation"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","earned","payable","paid","voided"]}}],"responses":{"200":{"description":"Revenue ledger page","content":{"application/json":{"schema":{"type":"object","required":["summary","entries","page","limit","hasMore"],"properties":{"summary":{"$ref":"#/components/schemas/RevenueDashboardSummary"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/RevenueLedgerEntry"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}},"/v1/revenue/ledger/export":{"get":{"summary":"Export the partner revenue ledger as CSV or JSON","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"environment","in":"query","schema":{"type":"string","enum":["sandbox","production"]}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"category","in":"query","schema":{"type":"string","enum":["claims","financing","litigation"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","earned","payable","paid","voided"]}},{"name":"format","in":"query","schema":{"type":"string","enum":["csv","json"]}}],"responses":{"200":{"description":"Revenue ledger export","content":{"application/json":{"schema":{"type":"object","required":["summary","entries"],"properties":{"summary":{"$ref":"#/components/schemas/RevenueDashboardSummary"},"entries":{"type":"array","items":{"$ref":"#/components/schemas/RevenueLedgerEntry"}}}}},"text/csv":{"schema":{"type":"string"}}}}}}},"/v1/notifications":{"post":{"summary":"Request a tracked partner notification for one client","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["clientId","type"],"properties":{"clientId":{"type":"string","format":"uuid"},"claimId":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["refund_opportunity","advance_offer","litigation_update","advance_disbursed","refund_received"]},"channel":{"type":"string","enum":["email"]},"deliveryMode":{"type":"string","enum":["dutyclaims_managed_email","partner_reply_to","custom_sender_domain"]},"context":{"type":"object","properties":{"headline":{"type":"string"},"body":{"type":"string"},"estimatedRefundUsd":{"type":"number"},"advanceAmountUsd":{"type":"number"},"litigationSummary":{"type":"string"},"ctaUrl":{"type":"string","format":"uri"}}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Partner notification request result","content":{"application/json":{"schema":{"type":"object","required":["request","outcome"],"properties":{"request":{"$ref":"#/components/schemas/PartnerNotificationRequest"},"outcome":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean"},"error":{"type":["string","null"]}}}}}}}}}}},"/v1/notifications/batches":{"post":{"summary":"Request a tracked partner notification for a filtered client batch","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"clientIds":{"type":"array","items":{"type":"string","format":"uuid"}},"filters":{"type":"object","properties":{"minimumRefundUsd":{"type":"number"},"claimStatus":{"type":"string"},"litigationCandidatesOnly":{"type":"boolean"},"activatedOnly":{"type":"boolean"}}},"type":{"type":"string","enum":["refund_opportunity","advance_offer","litigation_update","advance_disbursed","refund_received"]},"channel":{"type":"string","enum":["email"]},"deliveryMode":{"type":"string","enum":["dutyclaims_managed_email","partner_reply_to","custom_sender_domain"]},"context":{"type":"object","properties":{"headline":{"type":"string"},"body":{"type":"string"},"estimatedRefundUsd":{"type":"number"},"advanceAmountUsd":{"type":"number"},"litigationSummary":{"type":"string"},"ctaUrl":{"type":"string","format":"uri"}}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Partner notification batch result","content":{"application/json":{"schema":{"type":"object","required":["batchId","requests","counts"],"properties":{"batchId":{"type":"string","format":"uuid"},"requests":{"type":"array","items":{"$ref":"#/components/schemas/PartnerNotificationRequest"}},"counts":{"type":"object","required":["processed","sent","failed","skipped","paused","inAppOnly"],"properties":{"processed":{"type":"integer","minimum":0},"sent":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"paused":{"type":"integer","minimum":0},"inAppOnly":{"type":"integer","minimum":0}}}}}}}}}}},"/v1/clients/{clientId}/notification-history":{"get":{"summary":"Fetch partner-scoped notification history for one client","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"clientId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Partner notification history","content":{"application/json":{"schema":{"type":"object","required":["history","page","limit","hasMore"],"properties":{"history":{"type":"array","items":{"$ref":"#/components/schemas/PartnerNotificationRequest"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}},"/v1/notifications/analytics":{"get":{"summary":"Fetch aggregate delivery and engagement analytics for partner notifications","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"dateFrom","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"dateTo","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"type","in":"query","schema":{"type":"string","enum":["refund_opportunity","advance_offer","litigation_update","advance_disbursed","refund_received"]}}],"responses":{"200":{"description":"Partner notification analytics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationAnalyticsResponse"}}}}}}},"/v1/offers":{"get":{"summary":"List financing offers for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"responses":{"200":{"description":"Financing offers","content":{"application/json":{"schema":{"type":"object","required":["items","page","limit","hasMore"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":true}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}},"post":{"summary":"Create a financing quote or offer for a claim","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"responses":{"201":{"description":"Created financing offer","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/offers/{offerId}":{"get":{"summary":"Read a financing offer with agreement and event detail","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Financing offer detail","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/offers/{offerId}/accept":{"post":{"summary":"Request acceptance of a financing offer","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Offer acceptance requested","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/agreements/{agreementId}":{"get":{"summary":"Read financing agreement state","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"agreementId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agreement state","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/agreements/{agreementId}/session":{"post":{"summary":"Create or refresh a financing agreement signer session","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"agreementId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agreement signer session","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/advances/{advanceId}":{"get":{"summary":"Read a financing advance and its current disbursement state","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"advanceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Advance detail","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/advances/{advanceId}/disbursement":{"post":{"summary":"Initiate or queue disbursement for a financing advance","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"advanceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Disbursement queued","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/litigation/enroll":{"post":{"summary":"Request litigation enrollment for an eligible claim","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["claimId","requestedTrack"],"properties":{"claimId":{"type":"string","format":"uuid"},"requestedTrack":{"type":"string","enum":["protest_only","cit_only","protest_and_cit"]},"partnerCaseReference":{"type":"string"},"partnerNotes":{"type":"string"},"litigationPortionNote":{"type":"string"},"combinedPath":{"type":"object","properties":{"mode":{"type":"string","enum":["litigation_only","combined"]},"offerId":{"type":"string","format":"uuid"},"advanceId":{"type":"string","format":"uuid"}}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Litigation enrollment created","content":{"application/json":{"schema":{"type":"object","required":["litigationCase"],"properties":{"litigationCase":{"$ref":"#/components/schemas/LitigationCase"}}}}}}}}},"/v1/litigation/cases":{"get":{"summary":"List litigation cases for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"claimId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string","enum":["requested","blocked","ready_for_package","package_ready","delivered","active","closed"]}},{"name":"requestedTrack","in":"query","schema":{"type":"string","enum":["protest_only","cit_only","protest_and_cit"]}}],"responses":{"200":{"description":"Litigation case list","content":{"application/json":{"schema":{"type":"object","required":["items","page","limit","hasMore"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LitigationCase"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}}},"/v1/litigation/cases/{caseId}":{"get":{"summary":"Fetch a litigation case and its partner-safe status summary","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Litigation case detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationCase"}}}}}}},"/v1/litigation/cases/{caseId}/events":{"get":{"summary":"List structured events for a litigation case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Litigation case events","content":{"application/json":{"schema":{"type":"object","required":["caseId","events"],"properties":{"caseId":{"type":"string","format":"uuid"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LitigationEvent"}}}}}}}}},"post":{"summary":"Append a partner-originated litigation status or docket event","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventType","source","title","summary"],"properties":{"eventType":{"type":"string","enum":["status_updated","docket_updated"]},"source":{"type":"string","enum":["partner_api","operator_manual","provider_feed"]},"title":{"type":"string"},"summary":{"type":"string"},"statusAfter":{"type":"string","enum":["requested","blocked","ready_for_package","package_ready","delivered","active","closed"]},"nextKeyDate":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Updated litigation case events","content":{"application/json":{"schema":{"type":"object","required":["caseId","events"],"properties":{"caseId":{"type":"string","format":"uuid"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LitigationEvent"}}}}}}}}}},"/v1/litigation/packages/{claimId}":{"get":{"summary":"Fetch the latest litigation package readiness and delivery summary for a claim","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Litigation package summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LitigationPackageSummary"}}}}}}},"/v1/litigation/packages/{claimId}/download":{"get":{"summary":"Issue or consume a secure litigation package download link","parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"token","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Signed package download or binary package stream","content":{"application/json":{"schema":{"type":"object","required":["url","expiresAt"],"properties":{"url":{"type":["string","null"],"format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"}}}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}}},"/v1/litigation/packages/{claimId}/deliver":{"post":{"summary":"Request tracked delivery of a litigation package snapshot","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["recipients"],"properties":{"snapshotId":{"type":"string","format":"uuid"},"recipients":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"}}}},"secureNote":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Litigation package delivery result","content":{"application/json":{"schema":{"type":"object","required":["packageSummary","deliveries","events"],"properties":{"packageSummary":{"$ref":"#/components/schemas/LitigationPackageSummary"},"deliveries":{"type":"array","items":{"$ref":"#/components/schemas/LitigationPackageDelivery"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/LitigationEvent"}}}}}}}}}},"/v1/litigation/representation-readiness/{claimId}":{"get":{"summary":"Fetch shared litigation readiness for a claim and its current track","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"claimId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Litigation readiness summary","content":{"application/json":{"schema":{"type":"object","required":["claimId","requestedTrack","readiness"],"properties":{"claimId":{"type":"string","format":"uuid"},"requestedTrack":{"type":["string","null"],"enum":["protest_only","cit_only","protest_and_cit",null]},"readiness":{"$ref":"#/components/schemas/LitigationReadiness"}}}}}}}}},"/v1/counterparties":{"get":{"summary":"List counterparties for the authenticated partner","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"importerId","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty list","content":{"application/json":{"schema":{"type":"object","required":["counterparties","page","limit","hasMore"],"properties":{"counterparties":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyProfile"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}},"post":{"summary":"Create a counterparty profile","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["legalName"],"properties":{"clientId":{"type":"string","format":"uuid"},"partnerClientLinkId":{"type":"string","format":"uuid"},"importerId":{"type":"string","format":"uuid"},"externalCounterpartyId":{"type":"string"},"legalName":{"type":"string"},"entityType":{"type":"string"},"taxId":{"type":"string"},"taxIdType":{"type":"string"},"registeredAddress":{"$ref":"#/components/schemas/CounterpartyAddress"},"principalAddress":{"$ref":"#/components/schemas/CounterpartyAddress"},"duns":{"type":"string"},"claimExposureUsd":{"type":"number"},"beneficialOwnerRequired":{"type":"boolean"},"beneficialOwners":{"type":"array","items":{"type":"object","additionalProperties":true}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Counterparty created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyProfile"}}}}}}},"/v1/counterparties/{counterpartyId}":{"get":{"summary":"Fetch a counterparty profile","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"counterpartyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyProfile"}}}}}}},"/v1/counterparty-diligence/cases":{"get":{"summary":"List counterparty diligence cases","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","schema":{"type":"string","enum":["approved","review","rejected","pending"]}},{"name":"counterpartyId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"clientId","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty case list","content":{"application/json":{"schema":{"type":"object","required":["cases","page","limit","hasMore"],"properties":{"cases":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyCaseSummary"}},"page":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}}}},"post":{"summary":"Create a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["counterpartyId"],"properties":{"counterpartyId":{"type":"string","format":"uuid"},"assignedReviewerUserId":{"type":"string"},"gates":{"type":"array","items":{"type":"object","additionalProperties":true}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Counterparty diligence case","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyDiligenceDetail"}}}}}}},"/v1/counterparty-diligence/cases/{caseId}":{"get":{"summary":"Fetch a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty diligence case detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyDiligenceDetail"}}}}}}},"/v1/counterparty-diligence/cases/{caseId}/evidence":{"get":{"summary":"List evidence for a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty evidence","content":{"application/json":{"schema":{"type":"object","required":["evidence"],"properties":{"evidence":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyEvidence"}}}}}}}}},"post":{"summary":"Attach evidence to a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["category","title","storageReference"],"properties":{"category":{"type":"string"},"title":{"type":"string"},"storageType":{"type":"string"},"storageReference":{"type":"string"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Counterparty evidence created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyEvidence"}}}}}}},"/v1/counterparty-diligence/cases/{caseId}/report":{"get":{"summary":"Generate a partner-safe counterparty diligence report","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty diligence report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyDiligenceReport"}}}}}}},"/v1/counterparty-diligence/cases/{caseId}/provider-runs":{"get":{"summary":"List provider runs for a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty provider runs","content":{"application/json":{"schema":{"type":"object","required":["runs"],"properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyProviderRun"}}}}}}}}},"post":{"summary":"Trigger a provider run for a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["runType"],"properties":{"runType":{"type":"string","enum":["middesk_business_verification","middesk_lien_search","middesk_screening","dnb_match","dnb_financial_risk","springstreet_ucc_fallback","middesk_monitor_enrollment","dnb_monitor_enrollment"]},"allowSpringstreetFallback":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Counterparty provider run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CounterpartyProviderRun"}}}}}}},"/v1/counterparty-diligence/cases/{caseId}/monitoring":{"get":{"summary":"List monitoring subscriptions and alerts for a counterparty diligence case","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Counterparty monitoring state","content":{"application/json":{"schema":{"type":"object","required":["subscriptions","alerts"],"properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyMonitoringSubscription"}},"alerts":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyMonitorAlert"}}}}}}}}}},"/v1/counterparty-diligence/cases/{caseId}/monitoring/enroll":{"post":{"summary":"Enroll a cleared counterparty into provider-backed monitoring","security":[{"BearerApiKey":[]},{"OAuthBearer":[]}],"parameters":[{"name":"caseId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["activationReason"],"properties":{"activationReason":{"type":"string","enum":["financing_disbursed","litigation_enrolled","manual_operator"]},"responseProtocol":{"type":"string"},"providers":{"type":"array","items":{"type":"string","enum":["middesk","dnb"]}},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Counterparty monitoring state","content":{"application/json":{"schema":{"type":"object","required":["subscriptions","alerts"],"properties":{"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyMonitoringSubscription"}},"alerts":{"type":"array","items":{"$ref":"#/components/schemas/CounterpartyMonitorAlert"}}}}}}}}}}}}