{"openapi":"3.1.0","info":{"title":"Tiskz API","version":"1.0.0","description":"API gateway del panel de Tiskz. La consumen el servidor de llamadas y el servicio de IA para registrar incidentes, señales, datos observados y muestras de voz."},"servers":[{"url":"https://web-repo-xi.vercel.app/api/v1"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Authorization: Bearer tkz_..."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]}}},"Pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total":{"type":"integer"}}},"CaseFinalization":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"session_id":{"type":"string","minLength":1,"maxLength":200},"simulated":{"type":"boolean","const":true},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"ended_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"channel":{"type":"string","enum":["webrtc","telefono_vapi"]},"time_source":{"default":"session_started","type":"string","enum":["session_started","monitor_first_event"]},"text":{"type":"string","minLength":1,"maxLength":12000},"decision":{"default":null,"anyOf":[{"type":"object","properties":{"alerta":{"type":"boolean"},"probabilidad":{"type":"number","minimum":0,"maximum":1}},"required":["alerta","probabilidad"],"additionalProperties":false},{"type":"null"}]}},"required":["request_id","session_id","simulated","started_at","ended_at","channel","text"],"additionalProperties":false},"FinalizedFindings":{"type":"object","properties":{"schema_version":{"type":"string","const":"pe-v1"},"run_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"revision":{"type":"integer","minimum":1,"maximum":1000000},"session_id":{"type":"string","minLength":1,"maxLength":200},"simulated":{"type":"boolean"},"ended_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"analysis":{"type":"object","properties":{"risk_score":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"verdict":{"type":"string","enum":["none","safe","suspicious","scam"]},"risk_reasons":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"summary":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"recommendation":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"scam_type":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"impersonating":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"model_id":{"type":"string","minLength":1,"maxLength":200},"generation":{"type":"object","properties":{"provider":{"type":"string","enum":["xai","maritime"]},"status":{"type":"string","const":"completed"},"generation_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"prompt_version":{"type":"string","const":"pe-report-v1"},"model_id":{"type":"string","minLength":1,"maxLength":200},"usage":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}},"limitations":{"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":250}}},"required":["provider","status","generation_id","prompt_version","model_id","usage","limitations"],"additionalProperties":false}},"required":["risk_score","verdict","risk_reasons","summary","recommendation","scam_type","impersonating","model_id"],"additionalProperties":false},"signals":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":64},"explanation":{"type":"string","minLength":1,"maxLength":4000},"confidence":{"type":"number","minimum":0,"maximum":1},"source":{"type":"string","minLength":1,"maxLength":40},"analysis_meta":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","explanation","confidence","source"],"additionalProperties":false}},"entities":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":40},"value":{"type":"string","minLength":1,"maxLength":400},"provenance":{"type":"string","enum":["mencionado","mostrado","reportado_usuario","proveedor"]},"analysis_meta":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["kind","value","provenance"],"additionalProperties":false}}},"required":["schema_version","run_id","revision","session_id","simulated","ended_at","analysis","signals","entities"],"additionalProperties":false},"NetworkOrigin":{"type":"object","properties":{"version":{"type":"number","const":1},"binding":{"type":"object","properties":{"client_call_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_.:-]+$"},"conference_request_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"vapi_call_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"route":{"type":"string","const":"android_sim_conference"},"bound_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"bound_by":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_.:-]+$"}},"required":["client_call_id","conference_request_id","vapi_call_id","route","bound_at","bound_by"],"additionalProperties":false},"inspection":{"anyOf":[{"type":"object","properties":{"checked_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"source":{"type":"string","const":"vapi_get_call"},"evidence_ref":{"type":"string","pattern":"^\\/call\\/[a-f0-9-]{36}$"},"availability":{"type":"string","const":"unavailable"},"reason":{"type":"string","const":"original_endpoint_not_exposed"},"endpoint_ip":{"type":"null"},"call":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","maxLength":80},"status":{"type":"string","maxLength":80},"phoneCallProvider":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"phoneCallProviderId":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phoneCallTransport":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}}},{"type":"null"}]}},"required":["id"]}},"required":["checked_at","source","evidence_ref","availability","reason","endpoint_ip","call"]},{"type":"null"}]}},"required":["version","binding","inspection"]},"NetworkBinding":{"type":"object","properties":{"client_call_id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9_.:-]+$"},"conference_request_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"vapi_call_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"route":{"type":"string","const":"android_sim_conference"}},"required":["client_call_id","conference_request_id","vapi_call_id","route"],"additionalProperties":false},"CallInput":{"type":"object","properties":{"caller_number_raw":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"caller_e164":{"default":null,"anyOf":[{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},{"type":"null"}]},"caller_name":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"direction":{"default":"incoming","type":"string","enum":["incoming","outgoing"]},"call_status":{"default":"ended","type":"string","enum":["ringing","active","ended","rejected","missed"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"answered_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"ended_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"talk_duration_s":{"default":null,"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"simulated":{"default":false,"type":"boolean"},"blocked":{"default":false,"type":"boolean"},"screened":{"default":false,"type":"boolean"},"verdict":{"default":"none","type":"string","enum":["none","safe","suspicious","scam"]},"risk_score":{"default":0,"type":"integer","minimum":0,"maximum":100},"risk_reasons":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"scam_type":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"impersonating":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"summary":{"default":null,"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"transcript":{"default":[],"maxItems":1000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"speaker":{"type":"string","enum":["agent","caller","user"]},"text":{"type":"string","minLength":1,"maxLength":4000},"flagged":{"default":false,"type":"boolean"},"t_offset":{"default":null,"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["id","speaker","text"],"additionalProperties":false}}},"required":["started_at"],"additionalProperties":false},"TranscriptLine":{"type":"object","properties":{"id":{"type":"string"},"idx":{"type":"integer"},"speaker":{"type":["string","null"],"enum":["agent","caller","user",null]},"text":{"type":"string"},"flagged":{"type":"boolean"},"t_offset":{"type":"number"},"external_segment_id":{"type":["string","null"]}}},"Organizations":{"type":"object","description":"Organizaciones que reciben casos en el panel.","properties":{"id":{},"name":{},"created_at":{}}},"OrganizationsCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false},"OrganizationsUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200}},"additionalProperties":false},"Users":{"type":"object","description":"Personas que tuvieron la conversación (rol «usuario») y analistas del panel.","properties":{"id":{},"name":{},"role":{},"org_id":{},"settings":{},"created_at":{}}},"UsersCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"default":"usuario","type":"string","enum":["usuario","analista"]},"org_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"settings":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name"],"additionalProperties":false},"UsersUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["usuario","analista"]},"org_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"Incidents":{"type":"object","description":"Conversaciones analizadas. Solo aparecen en el panel de la organización indicada en org_id (null = no compartido).","properties":{"id":{},"external_id":{},"user_id":{},"org_id":{},"title":{},"channel":{},"status":{},"started_at":{},"ended_at":{},"risk_score":{},"risk_level":{},"summary":{},"recommendation":{},"analyst_status":{},"created_at":{},"updated_at":{},"suspect_id":{},"client_call_id":{},"provider_call_id":{},"agent_session_id":{},"caller_number_raw":{},"caller_e164":{},"caller_name":{},"direction":{},"call_status":{},"answered_at":{},"talk_duration_s":{},"agent_status":{},"ready_to_answer":{},"simulated":{},"blocked":{},"analysis_status":{},"verdict":{},"risk_reasons":{},"scam_type":{},"impersonating":{},"user_feedback":{},"user_feedback_at":{},"consent_snapshot":{},"analysis_meta":{},"shared_at":{},"sharing_revoked_at":{}}},"IncidentsCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"external_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"user_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"org_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"title":{"default":"Conversación","type":"string","minLength":1,"maxLength":300},"channel":{"default":"llamada","type":"string","minLength":1,"maxLength":40},"status":{"default":"en_curso","type":"string","enum":["en_curso","finalizado"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"ended_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"risk_score":{"default":0,"type":"integer","minimum":0,"maximum":100},"risk_level":{"type":"string","enum":["bajo","medio","alto"]},"summary":{"default":null,"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"recommendation":{"default":null,"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"analyst_status":{"default":"nuevo","type":"string","enum":["nuevo","en_revision","cerrado"]},"client_call_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"provider_call_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"agent_session_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"caller_number_raw":{"default":null,"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"caller_e164":{"default":null,"anyOf":[{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},{"type":"null"}]},"caller_name":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"direction":{"default":null,"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"call_status":{"default":null,"anyOf":[{"type":"string","enum":["ringing","active","ended","rejected","missed"]},{"type":"null"}]},"answered_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"talk_duration_s":{"default":null,"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"agent_status":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"ready_to_answer":{"default":false,"type":"boolean"},"simulated":{"default":false,"type":["boolean","null"]},"blocked":{"default":false,"type":"boolean"},"analysis_status":{"default":"pending","type":"string","enum":["pending","running","completed","failed"]},"verdict":{"default":"none","type":"string","enum":["none","safe","suspicious","scam"]},"risk_reasons":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"scam_type":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"impersonating":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"user_feedback":{"default":null,"anyOf":[{"type":"string","enum":["safe","scam","unsure"]},{"type":"null"}]},"user_feedback_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"consent_snapshot":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"analysis_meta":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"shared_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"sharing_revoked_at":{"default":null,"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"additionalProperties":false},"IncidentsUpdate":{"type":"object","properties":{"client_call_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"provider_call_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"agent_session_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"caller_number_raw":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"caller_e164":{"anyOf":[{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$"},{"type":"null"}]},"caller_name":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"direction":{"anyOf":[{"type":"string","enum":["incoming","outgoing"]},{"type":"null"}]},"call_status":{"anyOf":[{"type":"string","enum":["ringing","active","ended","rejected","missed"]},{"type":"null"}]},"answered_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"talk_duration_s":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"agent_status":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}]},"ready_to_answer":{"type":"boolean"},"simulated":{"type":["boolean","null"]},"blocked":{"type":"boolean"},"analysis_status":{"type":"string","enum":["pending","running","completed","failed"]},"verdict":{"type":"string","enum":["none","safe","suspicious","scam"]},"risk_reasons":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"scam_type":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"impersonating":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"user_feedback":{"anyOf":[{"type":"string","enum":["safe","scam","unsure"]},{"type":"null"}]},"user_feedback_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"consent_snapshot":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"analysis_meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"shared_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"sharing_revoked_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"user_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"org_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":300},"channel":{"type":"string","minLength":1,"maxLength":40},"status":{"type":"string","enum":["en_curso","finalizado"]},"started_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"ended_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"risk_score":{"type":"integer","minimum":0,"maximum":100},"risk_level":{"type":"string","enum":["bajo","medio","alto"]},"summary":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"recommendation":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"analyst_status":{"type":"string","enum":["nuevo","en_revision","cerrado"]},"suspect_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]}},"additionalProperties":false},"Signals":{"type":"object","description":"Señales inferidas por la IA, con su explicación (sin citas de la conversación: el panel no guarda transcripciones). Tipos conocidos: urgencia, dinero, datos_sensibles, secreto, amenaza, suplantacion, aislamiento (se aceptan otros).","properties":{"id":{},"incident_id":{},"type":{},"explanation":{},"confidence":{},"source":{},"analysis_meta":{},"created_at":{}}},"SignalsCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"type":{"type":"string","minLength":1,"maxLength":64},"explanation":{"type":"string","minLength":1,"maxLength":4000},"confidence":{"default":0.5,"type":"number","minimum":0,"maximum":1},"source":{"default":"ia","type":"string","minLength":1,"maxLength":40},"analysis_meta":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["incident_id","type","explanation"],"additionalProperties":false},"SignalsUpdate":{"type":"object","properties":{"analysis_meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"type":{"type":"string","minLength":1,"maxLength":64},"explanation":{"type":"string","minLength":1,"maxLength":4000},"confidence":{"type":"number","minimum":0,"maximum":1},"source":{"type":"string","minLength":1,"maxLength":40}},"additionalProperties":false},"Entities":{"type":"object","description":"Datos puntuales para Perú: telefono, cuenta, cci, billetera, monto y otros. normalized se recalcula en el servidor; cuentas requieren analysis_meta.bank para comparar y billeteras analysis_meta.wallet. Un dato repetido en el mismo incidente se ignora. Se conserva el original y su procedencia.","properties":{"id":{},"incident_id":{},"kind":{},"value":{},"normalized":{},"provenance":{},"analysis_meta":{},"created_at":{}}},"EntitiesCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"kind":{"type":"string","minLength":1,"maxLength":40},"value":{"type":"string","minLength":1,"maxLength":500},"normalized":{"type":"string","minLength":1,"maxLength":500},"provenance":{"default":"mencionado","type":"string","minLength":1,"maxLength":40},"analysis_meta":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["incident_id","kind","value"],"additionalProperties":false},"EntitiesUpdate":{"type":"object","properties":{"analysis_meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"kind":{"type":"string","minLength":1,"maxLength":40},"value":{"type":"string","minLength":1,"maxLength":500},"normalized":{"type":"string","minLength":1,"maxLength":500},"provenance":{"type":"string","minLength":1,"maxLength":40}},"additionalProperties":false},"VoiceSamples":{"type":"object","description":"Embeddings de voz (dato biométrico sensible). Se usan para proponer vínculos por similitud; la API nunca los devuelve.","properties":{"id":{},"incident_id":{},"duration_s":{},"profile_id":{},"model_id":{},"model_version":{},"speaker":{},"quality_status":{},"review_status":{},"reference_enabled":{},"source_session_ref":{},"embedding_dims":{},"created_at":{}}},"VoiceSamplesCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"embedding":{"minItems":16,"maxItems":4096,"type":"array","items":{"type":"number"}},"duration_s":{"default":null,"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"profile_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"model_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"model_version":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"speaker":{"default":"unknown","type":"string","enum":["caller","agent","user","unknown"]},"quality_status":{"default":"pending","type":"string","enum":["pending","usable","rejected"]},"review_status":{"default":"pendiente","type":"string","enum":["pendiente","aprobada","rechazada"]},"reference_enabled":{"default":false,"type":"boolean"},"source_session_ref":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["incident_id","embedding"],"additionalProperties":false},"VoiceSamplesUpdate":{"type":"object","properties":{"duration_s":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"profile_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"model_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"model_version":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"speaker":{"type":"string","enum":["caller","agent","user","unknown"]},"quality_status":{"type":"string","enum":["pending","usable","rejected"]},"review_status":{"type":"string","enum":["pendiente","aprobada","rechazada"]},"reference_enabled":{"type":"boolean"},"source_session_ref":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"additionalProperties":false},"VoiceProfiles":{"type":"object","description":"Agrupaciones vocales revisables con código estable; no acreditan identidad personal.","properties":{"id":{},"org_id":{},"public_code":{},"status":{},"simulated":{},"created_at":{}}},"VoiceProfilesCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"org_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"public_code":{"type":"string","minLength":1,"maxLength":80},"status":{"default":"provisional","type":"string","enum":["provisional","revisado","descartado"]},"simulated":{"default":false,"type":"boolean"}},"required":["org_id","public_code"],"additionalProperties":false},"VoiceProfilesUpdate":{"type":"object","properties":{"public_code":{"type":"string","minLength":1,"maxLength":80},"status":{"type":"string","enum":["provisional","revisado","descartado"]}},"additionalProperties":false},"Suspects":{"type":"object","description":"Alias que un analista da a casos que cree obra del mismo estafador. Sirve para llevar registro: no identifica a una persona. Los casos se asocian con PATCH /incidents/{id} { suspect_id }.","properties":{"id":{},"org_id":{},"alias":{},"notes":{},"status":{},"created_by":{},"created_by_id":{},"created_at":{},"updated_at":{}}},"SuspectsCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"org_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"alias":{"type":"string","minLength":1,"maxLength":80},"notes":{"default":"","type":"string","maxLength":2000},"status":{"default":"en_investigacion","type":"string","enum":["en_investigacion","descartado"]},"created_by":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["org_id","alias"],"additionalProperties":false},"SuspectsUpdate":{"type":"object","properties":{"alias":{"type":"string","minLength":1,"maxLength":80},"notes":{"type":"string","maxLength":2000},"status":{"type":"string","enum":["en_investigacion","descartado"]}},"additionalProperties":false},"Actions":{"type":"object","description":"Bitácora del incidente: captura iniciada, alerta mostrada, permiso otorgado, etc.","properties":{"id":{},"incident_id":{},"kind":{},"detail":{},"actor_id":{},"actor_kind":{},"result":{},"request_id":{},"link_id":{},"payload":{},"created_at":{}}},"ActionsCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"kind":{"type":"string","minLength":1,"maxLength":60},"detail":{"type":"string","minLength":1,"maxLength":2000},"actor_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"actor_kind":{"default":"system","type":"string","enum":["user","analyst","service","system"]},"result":{"default":"applied","type":"string","enum":["requested","applied","failed"]},"request_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"link_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"payload":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["incident_id","kind","detail"],"additionalProperties":false},"ActionsUpdate":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":60},"detail":{"type":"string","minLength":1,"maxLength":2000},"actor_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"actor_kind":{"type":"string","enum":["user","analyst","service","system"]},"result":{"type":"string","enum":["requested","applied","failed"]},"request_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"link_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"Notes":{"type":"object","description":"Correcciones, observaciones y conclusiones revisadas del incidente.","properties":{"id":{},"incident_id":{},"author_id":{},"author_name":{},"author_role":{},"kind":{},"text":{},"created_at":{}}},"NotesCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"author_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"author_name":{"default":"Servicio externo","type":"string","minLength":1,"maxLength":200},"author_role":{"default":"sistema","type":"string","minLength":1,"maxLength":40},"kind":{"default":"observacion","type":"string","enum":["correccion","observacion","conclusion"]},"text":{"type":"string","minLength":1,"maxLength":4000},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["incident_id","text"],"additionalProperties":false},"NotesUpdate":{"type":"object","properties":{"author_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"author_name":{"type":"string","minLength":1,"maxLength":200},"author_role":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","enum":["correccion","observacion","conclusion"]},"text":{"type":"string","minLength":1,"maxLength":4000}},"additionalProperties":false},"Links":{"type":"object","description":"Posibles relaciones entre dos incidentes. El panel también los calcula solo (voz, datos repetidos y patrón de señales). Filtra por incident_id para ver los de un caso.","properties":{"id":{},"incident_a":{},"incident_b":{},"score":{},"voice_sim":{},"content_sim":{},"reasons":{},"status":{},"reviewed_by":{},"reviewed_at":{},"note":{},"created_at":{},"reviewed_by_id":{},"evidence_snapshot":{},"evidence_version":{},"reviewed_evidence_version":{},"reviewed_evidence":{}}},"LinksCreate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_a":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"incident_b":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},"score":{"type":"number","minimum":0,"maximum":1},"voice_sim":{"default":null,"anyOf":[{"type":"number","minimum":-1,"maximum":1},{"type":"null"}]},"content_sim":{"default":0,"type":"number","minimum":0,"maximum":1},"reasons":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":40},"detail":{"type":"string","minLength":1,"maxLength":500}},"required":["kind","detail"],"additionalProperties":false}},"status":{"default":"pendiente","type":"string","enum":["pendiente","confirmado","descartado"]},"reviewed_by":{"default":null,"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"reviewed_by_id":{"default":null,"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"evidence_snapshot":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"note":{"default":null,"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["incident_a","incident_b","score"],"additionalProperties":false},"LinksUpdate":{"type":"object","properties":{"reviewed_by_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}]},"evidence_snapshot":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"score":{"type":"number","minimum":0,"maximum":1},"voice_sim":{"anyOf":[{"type":"number","minimum":-1,"maximum":1},{"type":"null"}]},"content_sim":{"type":"number","minimum":0,"maximum":1},"reasons":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","minLength":1,"maxLength":40},"detail":{"type":"string","minLength":1,"maxLength":500}},"required":["kind","detail"],"additionalProperties":false}},"status":{"type":"string","enum":["pendiente","confirmado","descartado"]},"reviewed_by":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"additionalProperties":false}}},"paths":{"/case-finalizations":{"post":{"tags":["Hallazgos"],"summary":"Entregar el cierre de un caso ficticio para analizarlo en la web","description":"Solo servidor. La web comprueba sus permisos y solicita la inferencia al agente Maritime. El contexto es transitorio; solo persiste hallazgos, resumen y hashes. request_id evita repetir la generación. Solo simulated=true en esta versión.","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseFinalization"}}}},"responses":{"200":{"description":"Generación completada o resultado de la entrega anterior."},"202":{"description":"La misma entrega sigue en curso; no se vuelve a invocar el modelo."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Permiso del reporte retirado o compartición revocada."},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Caso, request_id o generación incompatibles."},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"La generación falló; el caso no se considera seguro."},"503":{"description":"Maritime no configurado en el servidor web."}}}},"/incidents/{id}/findings":{"post":{"tags":["Hallazgos"],"summary":"Entregar hallazgos completos al finalizar una llamada","description":"Contrato pe-v1, solo servidor. Guarda señales, entidades, conclusión y constancia en una transacción. run_id idempotente y revisión creciente. No llama al modelo ni guarda transcripciones. La sesión debe coincidir con agent_session_id del incidente.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinalizedFindings"}}}},"responses":{"200":{"description":"Entrega guardada o reintento idéntico reconocido."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Compartición revocada."},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Sesión, origen, revisión o run_id incompatibles."},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/network-origin":{"get":{"tags":["Procedencia"],"summary":"Leer metadatos de origen autorizados","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Procedencia de la llamada; null si aún no se vinculó. La conferencia no aporta una IP original verificable.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/NetworkOrigin"},{"type":"null"}]}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Conservación no autorizada o compartición revocada."},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Identificadores incompatibles o llamada vinculada a otro incidente."},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Procedencia"],"summary":"Vincular conferencia Android con Vapi","description":"Solo servidor. client_call_id debe coincidir con el incidente. Requiere consent_snapshot.network_metadata_storage=true. Reintentos idénticos no duplican el registro.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkBinding"}}}},"responses":{"200":{"description":"Procedencia de la llamada; null si aún no se vinculó. La conferencia no aporta una IP original verificable.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/NetworkOrigin"},{"type":"null"}]}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Conservación no autorizada o compartición revocada."},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Identificadores incompatibles o llamada vinculada a otro incidente."},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Procedencia"],"summary":"Consultar metadatos de la llamada vinculada en Vapi","description":"Usa VAPI_PRIVATE_KEY en el servidor. No consulta GeoIP ni interpreta IPs de proxies como direcciones del interlocutor.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Procedencia de la llamada; null si aún no se vinculó. La conferencia no aporta una IP original verificable.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/NetworkOrigin"},{"type":"null"}]}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Conservación no autorizada o compartición revocada."},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Identificadores incompatibles o llamada vinculada a otro incidente."},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error o respuesta inválida del proveedor; conserva la última consulta correcta."},"503":{"description":"Falta configurar VAPI_PRIVATE_KEY."}}}},"/calls":{"get":{"tags":["Llamadas"],"summary":"Listar llamadas recientes con su conversación guardada","description":"Llamadas registradas por la app (con client_call_id), de la más reciente a la más antigua, con cuántas líneas de conversación tienen.","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"},"description":"Organización con la que la persona comparte sus llamadas."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"description":"Falta X-Tiskz-Org o el identificador no es válido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calls/{callId}":{"put":{"tags":["Llamadas"],"summary":"Guardar una llamada y su conversación","description":"La app la envía al terminar la llamada: datos de la llamada y la conversación completa (asistente, quien llama y titular). Reenviar el mismo callId actualiza la llamada y reemplaza la conversación; no duplica. Respuesta 201 al crear, 200 al actualizar.","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"},"description":"Organización con la que la persona comparte sus llamadas."},{"name":"callId","in":"path","required":true,"schema":{"type":"string"},"description":"client_call_id generado por Android."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallInput"}}}},"responses":{"200":{"description":"Actualizada."},"201":{"description":"Creada."},"400":{"description":"Falta X-Tiskz-Org o el identificador no es válido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"La persona revocó la compartición."},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Llamadas"],"summary":"Obtener una llamada con su conversación","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"},"description":"Organización con la que la persona comparte sus llamadas."},{"name":"callId","in":"path","required":true,"schema":{"type":"string"},"description":"client_call_id generado por Android."}],"responses":{"200":{"description":"Incidente y conversación ordenada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"incident":{"$ref":"#/components/schemas/Incidents"},"transcript":{"type":"array","items":{"$ref":"#/components/schemas/TranscriptLine"}}}}}}}}},"400":{"description":"Falta X-Tiskz-Org o el identificador no es válido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reputation/{number}":{"get":{"tags":["Llamadas"],"summary":"Reputación comunitaria de un número","description":"Cuántas llamadas reales marcaron el número como estafa o sospechoso (en cualquier organización) y en cuántos casos se mencionó, por ejemplo como número de Yape. Solo totales: no expone conversaciones, personas ni organizaciones. La app lo consulta mientras suena la llamada.","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"},"description":"Número en cualquier formato; se compara por sus últimos dígitos."}],"responses":{"200":{"description":"Totales del número.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"number_key":{"type":"string"},"reports":{"type":"integer"},"scam":{"type":"integer"},"suspicious":{"type":"integer"},"mentioned_in":{"type":"integer"},"last_reported_at":{"type":["string","null"],"format":"date-time"},"scam_type":{"type":["string","null"]},"impersonating":{"type":["string","null"]}}}}}}}},"400":{"description":"Falta X-Tiskz-Org o el identificador no es válido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/transcript":{"get":{"tags":["Llamadas"],"summary":"Conversación de un incidente","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"},"description":"Organización con la que la persona comparte sus llamadas."},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Líneas en orden.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TranscriptLine"}}}}}}},"400":{"description":"Falta X-Tiskz-Org o el identificador no es válido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio-fragments":{"post":{"tags":["Audio"],"summary":"Guardar WAV autorizado (misma operación que MCP)","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"request_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"consentimiento_conservacion":{"type":"boolean","const":true},"audio_base64":{"type":"string","minLength":42728,"maxLength":640060},"source":{"type":"string","enum":["webrtc_microphone","provider_mixed"]},"risk_percent":{"anyOf":[{"type":"integer","minimum":0,"maximum":100},{"type":"null"}]},"simulated":{"default":false,"type":"boolean"}},"required":["session_id","request_id","consentimiento_conservacion","audio_base64","source","risk_percent"],"additionalProperties":false}}}},"responses":{"201":{"description":"Metadatos; request_id idempotente por sesión."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Audio"],"summary":"Listar fragmentos autorizados de una sesión","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Hasta seis fragmentos; sin audio."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio-fragments/{id}":{"get":{"tags":["Audio"],"summary":"Recuperar WAV autorizado","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}},{"name":"session_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"WAV PCM16 mono 16 kHz","content":{"audio/wav":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"tags":["MCP"],"summary":"Herramientas de audio autorizado mediante MCP Streamable HTTP","description":"JSON-RPC MCP: tools/list y tools/call. Herramientas guardar_fragmento, listar_fragmentos y escuchar_fragmento. X-Tiskz-Org obligatorio; la clave de servicio es global y nunca debe distribuirse a la APK. WAV PCM16 mono 16 kHz, 1–15 segundos, máximo seis fragmentos por sesión. No genera embeddings ni identifica personas.","parameters":[{"name":"X-Tiskz-Org","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{},"method":{"type":"string"},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"Resultado JSON-RPC MCP; audio recuperado como contenido audio/wav en base64."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations":{"get":{"tags":["Organizaciones"],"summary":"Listar organizaciones","parameters":[{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Organizations"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Organizaciones"],"summary":"Crear organizaciones","description":"Organizaciones que reciben casos en el panel.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/OrganizationsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/OrganizationsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Organizations"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/organizations/{id}":{"get":{"tags":["Organizaciones"],"summary":"Obtener organizaciones","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Organizations"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Organizaciones"],"summary":"Actualizar organizaciones","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationsUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Organizations"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Organizaciones"],"summary":"Borrar organizaciones","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users":{"get":{"tags":["Personas"],"summary":"Listar personas","parameters":[{"name":"role","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por role (usa \"null\" para vacíos)."},{"name":"org_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por org_id (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Users"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Personas"],"summary":"Crear personas","description":"Personas que tuvieron la conversación (rol «usuario») y analistas del panel.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/UsersCreate"},{"type":"array","items":{"$ref":"#/components/schemas/UsersCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Users"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{id}":{"get":{"tags":["Personas"],"summary":"Obtener personas","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Users"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Personas"],"summary":"Actualizar personas","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsersUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Users"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Personas"],"summary":"Borrar personas","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents":{"get":{"tags":["Incidentes"],"summary":"Listar incidentes","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por org_id (usa \"null\" para vacíos)."},{"name":"user_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por user_id (usa \"null\" para vacíos)."},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por status (usa \"null\" para vacíos)."},{"name":"risk_level","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por risk_level (usa \"null\" para vacíos)."},{"name":"analyst_status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por analyst_status (usa \"null\" para vacíos)."},{"name":"channel","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por channel (usa \"null\" para vacíos)."},{"name":"external_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por external_id (usa \"null\" para vacíos)."},{"name":"client_call_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por client_call_id (usa \"null\" para vacíos)."},{"name":"agent_session_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por agent_session_id (usa \"null\" para vacíos)."},{"name":"simulated","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por simulated (usa \"null\" para vacíos)."},{"name":"verdict","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por verdict (usa \"null\" para vacíos)."},{"name":"suspect_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por suspect_id (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"started_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"started_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Incidents"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Incidentes"],"summary":"Crear incidentes","description":"Conversaciones analizadas. Solo aparecen en el panel de la organización indicada en org_id (null = no compartido).","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/IncidentsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/IncidentsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Incidents"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}":{"get":{"tags":["Incidentes"],"summary":"Obtener incidentes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","schema":{"type":"string"},"description":"Lista separada por comas: signals, entities, actions, notes, voice-samples, links."}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Incidents"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Incidentes"],"summary":"Actualizar incidentes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentsUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Incidents"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Incidentes"],"summary":"Borrar incidentes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signals":{"get":{"tags":["Señales de riesgo"],"summary":"Listar señales de riesgo","parameters":[{"name":"incident_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por incident_id (usa \"null\" para vacíos)."},{"name":"type","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por type (usa \"null\" para vacíos)."},{"name":"source","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por source (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Signals"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Señales de riesgo"],"summary":"Crear señales de riesgo","description":"Señales inferidas por la IA, con su explicación (sin citas de la conversación: el panel no guarda transcripciones). Tipos conocidos: urgencia, dinero, datos_sensibles, secreto, amenaza, suplantacion, aislamiento (se aceptan otros).","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SignalsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/SignalsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Signals"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signals/{id}":{"get":{"tags":["Señales de riesgo"],"summary":"Obtener señales de riesgo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Signals"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Señales de riesgo"],"summary":"Actualizar señales de riesgo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalsUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Signals"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Señales de riesgo"],"summary":"Borrar señales de riesgo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/signals":{"get":{"tags":["Señales de riesgo"],"summary":"Señales de riesgo de un incidente","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por type (usa \"null\" para vacíos)."},{"name":"source","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por source (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Signals"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Señales de riesgo"],"summary":"Agregar señales de riesgo a un incidente","description":"Señales inferidas por la IA, con su explicación (sin citas de la conversación: el panel no guarda transcripciones). Tipos conocidos: urgencia, dinero, datos_sensibles, secreto, amenaza, suplantacion, aislamiento (se aceptan otros). incident_id se toma de la URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SignalsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/SignalsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Signals"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/entities":{"get":{"tags":["Datos observados"],"summary":"Listar datos observados","parameters":[{"name":"incident_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por incident_id (usa \"null\" para vacíos)."},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por kind (usa \"null\" para vacíos)."},{"name":"normalized","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por normalized (usa \"null\" para vacíos)."},{"name":"provenance","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por provenance (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Entities"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Datos observados"],"summary":"Crear datos observados","description":"Datos puntuales para Perú: telefono, cuenta, cci, billetera, monto y otros. normalized se recalcula en el servidor; cuentas requieren analysis_meta.bank para comparar y billeteras analysis_meta.wallet. Un dato repetido en el mismo incidente se ignora. Se conserva el original y su procedencia.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EntitiesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/EntitiesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Entities"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/entities/{id}":{"get":{"tags":["Datos observados"],"summary":"Obtener datos observados","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Entities"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Datos observados"],"summary":"Actualizar datos observados","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitiesUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Entities"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Datos observados"],"summary":"Borrar datos observados","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/entities":{"get":{"tags":["Datos observados"],"summary":"Datos observados de un incidente","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por kind (usa \"null\" para vacíos)."},{"name":"normalized","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por normalized (usa \"null\" para vacíos)."},{"name":"provenance","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por provenance (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Entities"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Datos observados"],"summary":"Agregar datos observados a un incidente","description":"Datos puntuales para Perú: telefono, cuenta, cci, billetera, monto y otros. normalized se recalcula en el servidor; cuentas requieren analysis_meta.bank para comparar y billeteras analysis_meta.wallet. Un dato repetido en el mismo incidente se ignora. Se conserva el original y su procedencia. incident_id se toma de la URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EntitiesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/EntitiesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Entities"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-samples":{"get":{"tags":["Muestras de voz"],"summary":"Listar muestras de voz","parameters":[{"name":"incident_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por incident_id (usa \"null\" para vacíos)."},{"name":"profile_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por profile_id (usa \"null\" para vacíos)."},{"name":"model_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por model_id (usa \"null\" para vacíos)."},{"name":"review_status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por review_status (usa \"null\" para vacíos)."},{"name":"reference_enabled","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por reference_enabled (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceSamples"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Muestras de voz"],"summary":"Crear muestras de voz","description":"Embeddings de voz (dato biométrico sensible). Se usan para proponer vínculos por similitud; la API nunca los devuelve.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VoiceSamplesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/VoiceSamplesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceSamples"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-samples/{id}":{"get":{"tags":["Muestras de voz"],"summary":"Obtener muestras de voz","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceSamples"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Muestras de voz"],"summary":"Actualizar muestras de voz","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSamplesUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceSamples"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Muestras de voz"],"summary":"Borrar muestras de voz","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/voice-samples":{"get":{"tags":["Muestras de voz"],"summary":"Muestras de voz de un incidente","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"profile_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por profile_id (usa \"null\" para vacíos)."},{"name":"model_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por model_id (usa \"null\" para vacíos)."},{"name":"review_status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por review_status (usa \"null\" para vacíos)."},{"name":"reference_enabled","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por reference_enabled (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceSamples"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Muestras de voz"],"summary":"Agregar muestras de voz a un incidente","description":"Embeddings de voz (dato biométrico sensible). Se usan para proponer vínculos por similitud; la API nunca los devuelve. incident_id se toma de la URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VoiceSamplesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/VoiceSamplesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceSamples"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-profiles":{"get":{"tags":["Perfiles vocales"],"summary":"Listar perfiles vocales","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por org_id (usa \"null\" para vacíos)."},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por status (usa \"null\" para vacíos)."},{"name":"simulated","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por simulated (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/VoiceProfiles"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Perfiles vocales"],"summary":"Crear perfiles vocales","description":"Agrupaciones vocales revisables con código estable; no acreditan identidad personal.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VoiceProfilesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/VoiceProfilesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceProfiles"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/voice-profiles/{id}":{"get":{"tags":["Perfiles vocales"],"summary":"Obtener perfiles vocales","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceProfiles"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Perfiles vocales"],"summary":"Actualizar perfiles vocales","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProfilesUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/VoiceProfiles"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Perfiles vocales"],"summary":"Borrar perfiles vocales","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/suspects":{"get":{"tags":["Presuntos responsables"],"summary":"Listar presuntos responsables","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por org_id (usa \"null\" para vacíos)."},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por status (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Suspects"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Presuntos responsables"],"summary":"Crear presuntos responsables","description":"Alias que un analista da a casos que cree obra del mismo estafador. Sirve para llevar registro: no identifica a una persona. Los casos se asocian con PATCH /incidents/{id} { suspect_id }.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SuspectsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/SuspectsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Suspects"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/suspects/{id}":{"get":{"tags":["Presuntos responsables"],"summary":"Obtener presuntos responsables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Suspects"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Presuntos responsables"],"summary":"Actualizar presuntos responsables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuspectsUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Suspects"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Presuntos responsables"],"summary":"Borrar presuntos responsables","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/actions":{"get":{"tags":["Acciones y permisos"],"summary":"Listar acciones y permisos","parameters":[{"name":"incident_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por incident_id (usa \"null\" para vacíos)."},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por kind (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Actions"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Acciones y permisos"],"summary":"Crear acciones y permisos","description":"Bitácora del incidente: captura iniciada, alerta mostrada, permiso otorgado, etc.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ActionsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/ActionsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Actions"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/actions/{id}":{"get":{"tags":["Acciones y permisos"],"summary":"Obtener acciones y permisos","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Actions"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Acciones y permisos"],"summary":"Actualizar acciones y permisos","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionsUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Actions"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Acciones y permisos"],"summary":"Borrar acciones y permisos","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/actions":{"get":{"tags":["Acciones y permisos"],"summary":"Acciones y permisos de un incidente","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por kind (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Actions"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Acciones y permisos"],"summary":"Agregar acciones y permisos a un incidente","description":"Bitácora del incidente: captura iniciada, alerta mostrada, permiso otorgado, etc. incident_id se toma de la URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ActionsCreate"},{"type":"array","items":{"$ref":"#/components/schemas/ActionsCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Actions"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notes":{"get":{"tags":["Notas"],"summary":"Listar notas","parameters":[{"name":"incident_id","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por incident_id (usa \"null\" para vacíos)."},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por kind (usa \"null\" para vacíos)."},{"name":"author_role","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por author_role (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Notes"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Notas"],"summary":"Crear notas","description":"Correcciones, observaciones y conclusiones revisadas del incidente.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/NotesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/NotesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Notes"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/notes/{id}":{"get":{"tags":["Notas"],"summary":"Obtener notas","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Notes"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Notas"],"summary":"Actualizar notas","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotesUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Notes"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Notas"],"summary":"Borrar notas","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/incidents/{id}/notes":{"get":{"tags":["Notas"],"summary":"Notas de un incidente","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por kind (usa \"null\" para vacíos)."},{"name":"author_role","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por author_role (usa \"null\" para vacíos)."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Notes"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Notas"],"summary":"Agregar notas a un incidente","description":"Correcciones, observaciones y conclusiones revisadas del incidente. incident_id se toma de la URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/NotesCreate"},{"type":"array","items":{"$ref":"#/components/schemas/NotesCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Notes"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links":{"get":{"tags":["Vínculos"],"summary":"Listar vínculos","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"Filtra por status (usa \"null\" para vacíos)."},{"name":"incident_id","in":"query","schema":{"type":"string"},"description":"Vínculos donde participa el incidente."},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at >= since"},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"},"description":"created_at < until"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Links"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Vínculos"],"summary":"Crear vínculos","description":"Posibles relaciones entre dos incidentes. El panel también los calcula solo (voz, datos repetidos y patrón de señales). Filtra por incident_id para ver los de un caso.","requestBody":{"required":true,"description":"Un objeto o un arreglo (hasta 500) para crear en lote.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/LinksCreate"},{"type":"array","items":{"$ref":"#/components/schemas/LinksCreate"},"maxItems":500}]}}}},"responses":{"201":{"description":"Creado (o arreglo de creados).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Links"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}":{"get":{"tags":["Vínculos"],"summary":"Obtener vínculos","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Registro.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Links"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Vínculos"],"summary":"Actualizar vínculos","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinksUpdate"}}}},"responses":{"200":{"description":"Actualizado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Links"}}}}}},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Vínculos"],"summary":"Borrar vínculos","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Borrado."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/recompute":{"post":{"tags":["Vínculos"],"summary":"Recalcular vínculos propuestos","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"incident_id":{"type":"string"},"org_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Cantidad de incidentes recalculados."},"401":{"description":"Falta una API key válida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Datos inválidos.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}