{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/underwriting/assessments","version":"1.0.0","description":"List underwriting assessments"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/underwriting/assessments":{"get":{"tags":["credit"],"summary":"List underwriting assessments","description":"Assessments for this business.","operationId":"list_underwriting_assessments_api_v1_credit_underwriting_assessments_get","parameters":[{"name":"credit_line_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credit Line Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_list_UnderwritingAssessmentResponse__"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AssessmentStatusEnum":{"type":"string","enum":["pending","completed","failed"],"title":"AssessmentStatusEnum","description":"Underwriting assessment lifecycle.\n\nPlaid backfill, categorisation, and trailing-ratio history can take up\nto three days (FRD §9.3), so an assessment is explicitly asynchronous."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_list_UnderwritingAssessmentResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"items":{"$ref":"#/components/schemas/UnderwritingAssessmentResponse"},"type":"array"},{"type":"null"}],"title":"Data"}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[list[UnderwritingAssessmentResponse]]"},"UnderwritingAssessmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"credit_line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credit Line Id"},"external_application_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Application Id"},"status":{"$ref":"#/components/schemas/AssessmentStatusEnum"},"requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Requested At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"criteria":{"items":{"$ref":"#/components/schemas/UnderwritingCriterionResult"},"type":"array","title":"Criteria"},"financials":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Financials"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"decision":{"type":"null","title":"Decision","description":"Always null. The lending decision is the partner's (§9.3)."}},"type":"object","required":["id","status"],"title":"UnderwritingAssessmentResponse","description":"Assessment evidence — criteria, values, thresholds, and sources."},"UnderwritingCriterionResult":{"properties":{"key":{"type":"string","title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold"},"comparator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparator"},"passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed","description":"Null means the figure could not be measured yet — distinct from a failure, and calling for a different action."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"weight":{"type":"integer","title":"Weight","default":1},"required":{"type":"boolean","title":"Required","default":false},"evidence":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Evidence"}},"type":"object","required":["key"],"title":"UnderwritingCriterionResult","description":"One criterion, its value, its threshold, and where the figure came from.\n\nWe supply the assessment, not the verdict: thresholds and the lending\ndecision remain the partner's (§9.3)."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}